Solved

Supressing FRM-40209 message in Forms 9i

Posted on 2009-06-28
4
1,847 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 20

Expert Comment

by:flow01
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now