I’m working with oracle forms. I’ve a procedure I have to run whenever a specific field’s value is modified. The procedure I have to execute contains a go_block instruction, which can’t be used in the when_validate_item trigger. Is there anyway to bypass this?
EDIT
I have to use the when_validate_item, because the procedure I have to run has to be run when the field is modified, BUT BEFORE the validation is executed.
Usually there is a restriction on using
GO_BLOCKorGO_ITEMon aWHEN-VALIDATE-ITEM. However there are a couple of ways to overcome this. One way is to use aWHEN-TIMER-EXPIREDtrigger. Here is how-WHEN-TIMER-EXPIREDWHEN-VALIDATE-ITEMWhat happens is – This will create & expire the timer as soon as the
CREATE_TIMERfunction is called and then the form level triggerWHEN-TIMER-EXPIREDwill check the expired timer name and call your program unit that has theGO_BLOCK. Hope this helps.UPDATE
Mr Jeffery Kemp wanted to see proof that this solution works. So here it is-
An Oracle form with two Blocks
BLOCK1andBLOCK2with text items on itW-V-I Trigger
W-T-E Form Trigger. This calls a PROGRAM UNIT
P_CALL_PROCwithGO_BLOCKfunction call first and then does some validations on the fieldNumber 2.Here is
P_CALL_PROCAnd here is the result-
And
Here is a Youtube link to see the Form in action.