`

form 触发器的层次Before、Override、after的区别

 
阅读更多

问题描述:当我们在Form的BLOCK级里面增加了Trigger WHEN-NEW-RECORD-INSTANCE,导致我们的Form在AP上面运行时,按F11查询时,显示的底色是白色 ,标准的是蓝色。

 

问题解决:把Execution Hierarchy属性改为BEFORE就可以了

 

FORM触发器的三个层次:Before、Override、after

英文描述:

Specifies how the current trigger code should execute if there is a trigger with the same name defined at a higher level in the object hierarchy. 


 The following settings are valid for this property:

 Override :      Specifies that the current trigger fire instead of any trigger by the same name at any higher scope.    This is known as "override parent" behavior. 
 Before    :    Specifies that the current trigger fire before firing the same trigger at the next-higher scope.  This is known as "fire before parent" behavior. 
 After       :  Specifies that the current trigger fire after firing the same trigger at the next-higher scope.  This is known as "fire after parent" behavior.

 

触发器实例:

当一个事件发生的时候,Forms Engine可一并触发由低到高3个级别(Item、Block、
Form)的同名事件,如何触发,由定义低级别的事件时所设置的执行层次决定。
Execution Hierarchy:
1、 Override模式,默认模式,不再触发高级别事件
2、 Before模式,触发完本级别的事件后,再触发高级别事件
3、 After模式,先触发高级别事件,再回来触发本级别事件
当然了,如果某一层次我们没定义事件代码,Forms Engine就跳过该级别,直接进入
下一级别。
此外,Block中任何Item发生的事件,都可能引发该Block级事件,所以在Block级写本
属于Item级的事件,要特别性能问题;Form级事件更有类似问题。
例子. WHEN-VALIDATE-ITEM例子
假设:
1、 Item XXX的WHEN-VALIDATE-ITEM的代码是“代码1”,模式是“After”;
2、 Item XXX所在BlockWHEN-VALIDATE-ITEM的代码是“代码2”,模式是
“Override”;
3、 Form级WHEN-VALIDATE-ITEM的代码是“代码3”。
事件:发生Item XXX的WHEN-VALIDATE-ITEM
那么:实际先执行“代码2”,然后执行“代码1”。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics