Supressing FRM-40209 message in Forms 9i

Posted on 2009-06-28
Last Modified: 2012-05-07
Hi experts
Please provide me a solution to supress FRM-40209 error message. Here's the requirement - There are about 50 database text items in the form that are grouped accodingly. The user should input a non negative number and they can additionally enter n/a or na that should be treated as 0. Each group has a total that is also data entered by the user & henceforth converting na to 0 should be done at text item level so as to compute totals easily (no block level trigger).

I've written 2 triggers for each text items to accomplish this to some extend
1. KEY-NEXT-ITEM - This handles the non negative numbers perfectly. No issues at all
2. ON-ERROR - This is fired when the user enters NA (verified using message). However it fails to assign the entered text from NA to 0 and also fires "FRM-40209: Field must be of form 999,999,999" 3 times (not sure from where).

My question is...
1. How can I supress this "FRM-" message from appearing & should not affect anything else and also treat NA as 0
2. Having these 2 triggers is also affecting the "TAB" functionality in the forms. (After hitting the TAB key, the cursor still stays in the text item unless I use the mouse to click on different text item. This happens even if a right numeric value is entered). How can I over come this?

Note - I've set :MESSAGE_LEVEL to 0 & 5 which did not supress the error messages.

Thanks in advance for any help.
Code in ON-ERROR
	mAlert	Number;
	mAlert := Show_Alert('CLOSE_ALERT');
	If Upper(:SCR_0) = 'NA' OR Upper(:SCR_0) = 'N/A' OR Upper(:SCR_0) = 'N.A' Then
		:SCR_0 := 0;
	End If;
	mAlert	Number;
	If :SCR_0 < 0 Then
		SET_ALERT_PROPERTY('CLOSE_ALERT',ALERT_MESSAGE_TEXT,'Please enter a non negative number');
		mAlert := Show_Alert('CLOSE_ALERT');
		:SCR_0 := 0;
	End If;

Open in new window

Question by:aarganesh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 20

Expert Comment

ID: 24730950
Remove the format from your text_item and make the item a char field. (you want your user to be able to enter NA)

Add your own validation of format in the when validate item of the fields.

something like
        If Upper(:numfield) = 'NA' OR Upper(:numfield) = 'N/A' OR Upper(:numfield) = 'N.A' Then
                :numfield := 0;
        End If;
              n1 number;
          n1 := :numfield;
        exception when others then
                message ('enter a numeric character or NA (not available)');

when interception an key_trigger you remove the default behaviour of that key

add the build-in
add the end of your key_next_item-trigger to activate the default behaviour

Author Comment

ID: 24732674
Thanks for the suggestion.
I've used CHAR field before, but then I found the following shortfalls...

1. There're calculations based on these data entry fields. E.g. I enter a number in FIELD1 (numfield), there is somewhere a FIELD9 that shows FIELD1+FIELD2+FIELD3+FIELD4+FIELD5. So when I enter NA in FIELD1, it throws a FORMULA-CALCULATION error (FRM-40735)
2. Another requirement of the users is to accept "," during input. So if FIELD1(numfield) is a character field and the input is 999,9 then I get an error. So I'd to write down a big piece of code to scan the entire string to eliminate the "," & get a final number. Moreover, this large code has to be copied over to about 50 different fields.

Any other suggestions please?

Also requesting you to elaborate on the following

"when interception an key_trigger you remove the default behaviour of that key

add the build-in
add the end of your key_next_item-trigger to activate the default behavior"

Thanks for any help.

Author Comment

ID: 24742011
What a poor response? Its more than 2 days since I've posted this question & there's no solution. Technology really frustrates now!!!

Accepted Solution

aarganesh earned 0 total points
ID: 24746729
I fixed it myself using 2 triggers ON-ERROR to handle the NA part & WHEN-VALIDATE-ITEM to handle the negative number.

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question