Key-commit [message #234073] |
Sun, 29 April 2007 08:30 |
santoshbahir123
Messages: 4 Registered: April 2007 Location: Bangalore
|
Junior Member |
|
|
Hi,
I have one database block and one find block on a form. I enter search a criteria in the find block and corresponding output is displayed in the other block which is based on the database table. There are some mandatory fields on the database block. So when I tried to update the existing record or tried to enter the new record in the database block and missed any mandatory field, the message (“Please enter the field”) is shown for all the records present in the database block, instead of showing for only one record for which the field is missing.
I got the reason for the same. It is because of the KEY-COMMIT trigger, I have written.
This trigger is getting fired for all the records present in the database block and consequently the message is shown for all the records.
But I want the message to be fired for only one record for which the mandatory field is missing.
Please let me know if anybody knows the solution for the same.
Thanks,
Santosh
|
|
|
Re: Key-commit [message #234106 is a reply to message #234073] |
Mon, 30 April 2007 01:11 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I'd say that you are mistaken ... if the error message appears at the COMMIT point, it is too late - if this item's "Required" property is set to "Yes", error message would appear as soon as you try to skip this item without entering the value in it. So, it can not happen for all records, but only the current one.
Another possibility is that "Required" property is not set. Then you'd have to write your own WHEN-VALIDATE-ITEM trigger.
However, if you didn't do any of those, COMMIT would raise an exception (can not enter NULL into the NOT NULL column).
|
|
|