FRM-40508 [message #387376] |
Thu, 19 February 2009 00:59 |
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 #387413 is a reply to message #387397] |
Thu, 19 February 2009 02:48 |
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 #387566 is a reply to message #387417] |
Thu, 19 February 2009 22:46 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS 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
|
|
|