Change Forms trigger firing sequence [message #122140] |
Fri, 03 June 2005 05:18 |
t.paisley
Messages: 3 Registered: June 2005
|
Junior Member |
|
|
Hi,
I've got a multi-row block (PARENTVAL) with a relation to another block (CHILDVAL).
My problem is that the WHEN-VALIDATE-RECORD trigger fires twice on the PARENTVAL block. I believe this is because it first fires the ON-CLEAR-DETAILS and ON-POPULATE-DETAILS triggers - and for some reason it fires the WHEN-VALIDATE-RECORD trigger from within the ON-POPULATE-DETAILS trigger and then again after it completed the ON-POPULATE-DETAILS trigger.
I've re-coded the KEY-UP/DOWN/NXTREC/PREVREC triggers for navigation using keys and this forces the ON-CLEAR/ON-POPULATE-DETAILS triggers to be fired AFTER the WHEN-VALIDATE-RECORD, but I don't know how to do this for mouse navigation. Does anybody have any ideas?
Thanks,
Tanja
|
|
|
|
Re: Change Forms trigger firing sequence [message #122471 is a reply to message #122315] |
Mon, 06 June 2005 11:42 |
t.paisley
Messages: 3 Registered: June 2005
|
Junior Member |
|
|
Thanks for you help, David!
I tried what you suggested and the problem seems to be that I raise a FORM_TRIGGER_FAILURE in my WHEN-VALIDATE-RECORD trigger to prevent the user from navigating into another record (I want them to correct the error before they can move on). Are there any other ways of achieving this?!?
Tanja
|
|
|
|
Re: Change Forms trigger firing sequence [message #122563 is a reply to message #122505] |
Tue, 07 June 2005 05:34 |
t.paisley
Messages: 3 Registered: June 2005
|
Junior Member |
|
|
My problem is that the error message fires twice and has to be confirmed twice. It's just not very neat.
I tried using the WHEN-NEW-RECORD-INSTANCE trigger instead of the up/down/nxt/prev triggers as you suggested, but WHEN-NEW-RECORD-INSTANCE fires after WHEN-VALIDATE-RECORD as opposed to the up/down/nxt/prev triggers who fire beforehand (ie. using up/down/nxt/prev prevents WVR from firing twice (when using keys), WNRI doesn't). I think I might just leave it and see if the users notice it...
|
|
|
Re: Change Forms trigger firing sequence [message #122666 is a reply to message #122563] |
Tue, 07 June 2005 21:28 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
My first suggerstion is that you use the WHEN-VALIDATE-ITEM trigger on each of the data fields. Then use WVR. I only use the WNRI to enable and disable fields for navigation and access/permission purposes. I recommend that you DON'T use up/down/nxt/prev for doing validation.
David
|
|
|