简单整理一点 Form 页面中的触发器执行顺序内容。
一、打开一个Form页面时:
(1) PRE-FORM
(2) PRE-BLOCK(BLOCK级)
(3) WHEN-NEW-FORM-INSTANCE
(4) WHEN-NEW-BLOCK-INSTANCE
(5) WHEN-NEW-RECORD-INSTANCE
(6) WHEN-NEW-ITEM-INSTANCE
二、F11查询过程
(1) WHEN-CLEAR-BLOCK
(2) WHEN-NEW-RECORD-INSTANCE
(3) WHEN-NEW-ITEM-INSTANCE
在输入查询条件后点CTRL+F11:
(4) PRE-QUERY
(5) WHEN-CLEAR-BLOCK
(6) POST-QUERY
(7) WHEN-NEW-RECORD-INSTANCE
(8) WHEN-NEW-ITEM-INSTANCE
三、直接Ctrl + F11 查询
(1) WHEN-CLEAR-BLOCK
(2) PRE-QUERY
(3) WHEN-CLEAR-BLOCK
(4) POST-QUERY(每查一条记录,触发一次)
(5) WHEN-NEW-RECORD-INSTANCE
(6) WHEN-NEW-ITEM-INSTANCE
四、F4退出F11查询状态,变为输入状态
(1) WHEN-CLEAR-BLOCK
(2) KEY-EXIT
(3) WHEN-NEW-RECORD-INSTANCE
(4) WHEN-NEW-ITEM-INSTANCE
五、手电筒查询操作
(1) QUERY_FIND(BLOCK级)
输入查询条件后,点击“查询”按钮:
(2) WHEN-CLEAR-BLOCK
(3) PRE-QUERY
(4) WHEN-CLEAR-BLOCK
(5) POST-QUERY
(6) WHEN-NEW-RECORD-INSTANCE
(7) WHEN-NEW-ITEM-INSTANCE
六、使用 F4 退出
(1) KEY-EXIT
(2) POST-FORM
七、新增一行记录,光标移动到下一行时【INSERT】
(1) WHEN-VALIDATE-RECORD
(只将填写的记录与数据库中已存在的记录作唯一性的验证,如果只是页面上的数据重复而数据库中没有与其重复的值则不会报错.)
(2) WHEN-NEW-RECORD-INSTANCE
(3) WHEN-NEW-ITEM-INSTANCE
八、保存新增数据记录时【INSERT-SAVE】
在触发器 WHEN-VALIDATE-RECORD 进行数据验证时,在将页面上的所有数据提交到数据库,若页面上有重复数据,在提交第一条重复记录时显示为成功,但是只是将数据先写入到数据库一类似于临时表的地方,在提交第二条重复记录时则会报错,进而执行事务回滚,原来执行成功的指令操作也会被撤销。
(1) WHEN-VALIDATE-RECORD
(2) PRE-INSERT
(3) ON-INSERT
(4) POST-INSERT
(5) POST-FORMS-COMMIT
(6) PRE-BLOCK(BLOCK级)
(7) KEY-COMMIT
(8) WHEN-NEW-ITEM-INSTANCE
九、光标移动至已经显示的数据行上时
(1) WHEN-REMOVE-RECORD
(2) WHEN-NEW-RECORD-INSTANCE
(3) WHEN-NEW-ITEM-INSTANCE
当在该行上的不同ITEM移动时:
(4)WHEN-NEW-ITEM-INSTANCE
十、进行数据修改时【UPDATE】
(1)ON-LOCK
十一、修改结束进行保存【UPDATE-SAVE】
(1) WHEN-VALIDATE-RECORD
(2) PRE-UPDATE
(3) ON-UPDATE
(4) POST-FORMS-COMMIT
(5) PRE-BLOCK(BLOCK级)
(6) KEY-COMMIT
(7) WHEN-NEW-ITEM-INSTANCE
十二、删除一行数据记录时【DELETE】
(1) ON-LOCK
(2) WHEN-REMOVE-RECORD
(3) KEY-DELREC
(4) WHEN-NEW-RECORD-INSTANCE
(5) WHEN-NEW-ITEM-INSTANCE
十三、点击右上角小叉号关闭时
(1) WHEN-WINDOW-CLOSED
(2) CLOSE-WINDOW
(3) KEY-EXIT
(4) POST-FORM
十四、“Close Form”按钮关闭时
(1) KEY-EXIT
(2) POST-FORM
十五、点击“NEW”新建记录行时
(1) WHEN-NEW-RECORD-INSTANCE
(2) WHEN-NEW-ITEM-INSTANCE
十六、点击“Clear Record”清除记录时
(1) WHEN-REMOVE-RECORD
(2) POST-QUERY
(3) WHEN-NEW-RECORD-INSTANCE
(4) WHEN-NEW-ITEM-INSTANCE
十七、选中记录前面的小条时
(1) WHEN-NEW-RECORD-INSTANCE
(2) WHEN-NEW-ITEM-INSTANCE(数据项级)
(3) WHEN-NEW-ITEM-INSTANCE
十八、光标在记录上移动时
(1) WHEN-NEW-RECORD-INSTANCE
(2) WHEN-NEW-ITEM-INSTANCE
十九、选中LOV列表时
(1) KEY-LISTVAL
(2) WHEN-NEW-ITEM-INSTANCE
+++==========================================================================+++
以上内容仅为个人学习记录使用。
如有转载,请附有原文出处链接。
参考链接:
https://www.cnblogs.com/quanweiru/archive/2012/12/28/2837137.html
https://blog.csdn.net/weixin_33824363/article/details/85533590