Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Supressing FRM-40209 message in Forms 9i

Posted on 2009-06-28
Medium Priority
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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

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.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression

722 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