GO_BLOCK in WHEN_VALIDATE Trigger




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

up vote 6 down vote accepted

Usually there is a restriction on using GO_BLOCK or GO_ITEM on a WHEN-VALIDATE-ITEM. However there are a couple of ways to overcome this. One way is to use a WHEN-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 immediately
End;

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


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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值