Oracle EBS: "When-leave-record" trigger in Oracle Forms

Source: Internet
Author: User
When developing Oracle Forms, do I have such a requirement? I need to execute an operation every time I leave a row of records. When when-validate-record is used, but in actual testing, how can this problem be solved sometimes? Have you tried when-leave-record? What? And when-leave-record? I have never heard ......

Before requesting the when-leave-record, let's analyze several when triggers we have seen:

When-New-record-instance
The cursor is triggered every time you enter a new row.

When-create-record
This operation is triggered when a row is inserted. If no data is input, system. record_status is new. After the data is input, system. record_status changes to insert.

When-validate-record
When the cursor leaves the current row, and the last time the current row was between when-validate-record and the time when the row was left, the data of the row is triggered when it was changed.

When a new row of data is inserted and system. record_status changes to insert, the removal is triggered once. However, when the mouse enters the row again and intends to move out, the row does not change during this period, even though the system of the row. record_status is still insert (if not saved), but does not trigger the when-validate-record event.

Similarly, when a row of data is modified and system. record_status changes to changed, the row is triggered once after the row is removed. However, when the mouse enters the row again and intends to move out, the row does not change during this period, even though the system of the row. record_status is still changed (if not saved), The when-validate-record event will not be triggered again.

Well, the time is almost ripe. It's time to start when-leave-record, Dangdang ......

How can we execute an operation every time we remove a row? From the above analysis, we know that when-validate-record does not trigger every time it leaves, but does not seem to have triggers like when-leave-record, is there no other way to deal with such a demand?
Of course not. We only need to think carefully about the trigger condition of when-validate-record. It is not difficult to find that it is triggered only when the data in the row changes when-validate-record. In this case, we manually change the data on the row to cause the when-validate-record. For example, add a non-database item (itm_dummy) to the block (blk_dummy). For the convenience of subsequent descriptions, It is set as a numeric type and the initial value is 1 ), then change the value of this item in the when-New-record-instance (because the when-New-record-instance will be unconditionally triggered every time a row is entered) (you can do this :: blk_dummy.itm_dummy
: = Nvl (: blk_dummy.itm_dummy, 1) + 1;). This means that the when-validate-record has been transformed into our own when-leave-record trigger.

How is it easy? Develop your own when-leave-record trigger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.