Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Supressing FRM-40209 message in Forms 9i

Posted on 2009-06-28
4
Medium Priority
?
1,951 Views
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
Declare
	mAlert	Number;
Begin
	SET_ALERT_PROPERTY('CLOSE_ALERT',ALERT_MESSAGE_TEXT,'From ON-ERROR-TEXT-ITEM WITH ERROR CODE '||ERROR_CODE||'- '||ERROR_TEXT||' '||Upper(:SCR_0));
	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;
End;
 
Code in KEY-NEXT-ITEM
Declare
	mAlert	Number;
Begin
	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;
End;

Open in new window

0
Comment
Question by:aarganesh
  • 3
4 Comments
 
LVL 21

Expert Comment

by:flow01
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;
        declare
              n1 number;
        begin      
          n1 := :numfield;
        exception when others then
                message ('enter a numeric character or NA (not available)');
                raise;
        end;

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

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

Author Comment

by:aarganesh
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
next_item;
add the end of your key_next_item-trigger to activate the default behavior"

Thanks for any help.
0
 

Author Comment

by:aarganesh
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!!!
0
 

Accepted Solution

by:
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

885 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