Navigation Restriction against validated record [message #383874] |
Fri, 30 January 2009 19:40  |
 |
didiera
Messages: 134 Registered: August 2007 Location: Mauritius
|
Senior Member |
|
|
Hello people,
I have been wrestling with forms to implement a required behaviour. I have created a forms where validation of required fields be done in a procedure prior to the issue of a commit in a save button. Users can navigate around in the block and modify or enter new records. I intend to prevent users from creating more than 1 new blank record until at least they provide the required data. Actually they won't have to save after each record but validation is meant to prevent them from pressing down arrow several times and enter blank records since my validation logic is record-level based. I found that the When-Create-Record trigger comes handy to serve this purpose as it fires just when forms is trying to create a new record and with a raise form_trigger_failure you can even cancel the new record. Trouble comes when I launch the forms in debug mode and actually follow the course of execution.
Test Case : I have just created a blank record by navigating from a valid queried one. This works fine. Now I'm on my new record and I haven't yet keyed-in anything and I'm pressing on down arrow. What I did was to make a call to my validation procedure within the When-Create-Record trigger, but that defeats the logic because, at block level, Forms seems to have already moved to the new blank record and even if I fill in all the required fields from the previous (new) record, validation won't let me move on to the new record.
Do you know of a better way or how I could fix this.
regards,
Didz
|
|
|
|
|
|