Home » Developer & Programmer » Forms » FRM-40508
FRM-40508 [message #387376] Thu, 19 February 2009 00:59 Go to next message
handala
Messages: 5
Registered: February 2009
Location: Palestine
Junior Member

Hey All,

I'm new with form developer10G,
I have a form, when I try to insert an error message appear, "FRM-40508 Unable to insert record"
I guess the cause is:
I have a composite primary key, and sometimes somebody try to insert an already exist data.

How can I catch this error and show a message, tells that "the record is already exist.

Thanx to All
Re: FRM-40508 [message #387397 is a reply to message #387376] Thu, 19 February 2009 02:05 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Don't guess - when this message appears, go to Help menu and choose "Display error" - it will show statement which had failed, along with ORA-xxxxx error message code. This might help finding out what went wrong.
Re: FRM-40508 [message #387413 is a reply to message #387397] Thu, 19 February 2009 02:48 Go to previous messageGo to next message
handala
Messages: 5
Registered: February 2009
Location: Palestine
Junior Member

Thanks for your replay

I Know whats the cause "ORA-00001: unique constraint"

so when an employee tried to insert an already exist record, I want to pop up an alert tell them so .

I think If I user On_error trigger, but I donna know the code of the error.

Re: FRM-40508 [message #387417 is a reply to message #387413] Thu, 19 February 2009 03:15 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Search the board for use of the ON-ERROR trigger; there've been examples which will show you how to use it.
Re: FRM-40508 [message #387566 is a reply to message #387417] Thu, 19 February 2009 22:46 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
You could also use a 'When-Validate-Item' trigger on the key and test to see if it already exists.

You have said that you have a composite key so you would need to have a procedure which tests that all the fields of the key have been populated before testing whether it exists already or not. Place this code in a 'Forms Procedure' and execute the procedure from the WVI of each of the components. You do it on each item and not just the last one because there will be a user somewhere, sometime who will enter the information in the items in the reverse order.

David
Previous Topic: Framing a search query at run time, considering columns from diff tables.
Next Topic: FRM-10769
Goto Forum:
  


Current Time: Tue Dec 06 14:27:00 CST 2016

Total time taken to generate the page: 0.13705 seconds