GO_BLOCK in WHEN_VALIDATE Trigger

来源:互联网 发布:连锁超市软件 编辑:程序博客网 时间:2024/05/16 01:27



1down votefavorite

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.

share|improve this question
 
 

3 Answers 3

activeoldest votes
up vote6down voteaccepted

Usually there is a restriction on using GO_BLOCK or GO_ITEM on aWHEN-VALIDATE-ITEM. However there are a couple of ways to overcome this. One way is to use aWHEN-TIMER-EXPIRED trigger. Here is how-

WHEN-TIMER-EXPIRED

Begin    if GET_APPLICATION_PROPERTY(TIMER_NAME) = 'NEW_TIMER' then       CALL_PROG_UNIT(); --This is your Procedure that calls the GO_BLOCK      /*Do rest of validation here*/end if;END;

WHEN-VALIDATE-ITEM

DECLARE      timer_id TIMER;    Begin          timer_id := CREATE_TIMER('NEW_TIMER',1,NO_REPEAT);    --set a short timer so that the WHEN-TIMER-EXPIRED trigger is fired immediatelyEnd;

What happens is - This will create & expire the timer as soon as the CREATE_TIMER function is called and then the form level triggerWHEN-TIMER-EXPIRED will check the expired timer name and call your program unit that has theGO_BLOCK. Hope this helps.


http://stackoverflow.com/questions/12608330/go-block-in-when-validate-trigger

0 0