Home » Developer & Programmer » Forms » Navigation Restriction against validated record (Oracle Forms 6i)
Navigation Restriction against validated record [message #383874] Fri, 30 January 2009 19:40 Go to next message
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

Re: Navigation Restriction against validated record [message #383884 is a reply to message #383874] Sat, 31 January 2009 00:07 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As you want to restrict users from opening too many empty new records, how about doing that in the KEY-NXTREC or/and WHEN-NEW-RECORD-INSTANCE triggers (instead of the WHEN-CREATE-RECORD one)?
Re: Navigation Restriction against validated record [message #384035 is a reply to message #383884] Sun, 01 February 2009 22:57 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello,

I think you are right but from what I have seen so far, Validation still doesn't apply on the right record I'm afraid. You see it's quite tricky in fact because I intend to get the previous record validated before the creation of a new and all this during a 'transition' trigger...I'm not quite sure which I should choose and how ti implement that 'previous record' validation thing. Anyway thanks for the suggestion.


regards,
Didz
Re: Navigation Restriction against validated record [message #384252 is a reply to message #384035] Tue, 03 February 2009 00:38 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
You are working at the record level, use a 'record' level trigger. I suggest the 'post_record' trigger.

David
Previous Topic: Forms with two screens
Next Topic: How to create the parameter?
Goto Forum:
  


Current Time: Sun Dec 04 13:02:14 CST 2016

Total time taken to generate the page: 0.07331 seconds