Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the execution order of Oracle Form triggers?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "Oracle Form trigger execution order is how", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "Oracle Form trigger execution order is how" it!

The priority of Trigger for Form is from item to block to form level, and if the Execution Hierarch property (override,before,after) is set separately, it will be executed in the order in which it is set. If it is override, then after executing this level of trigger, it will not be executed upwards. Before means that after executing this level of trigger, if the previous level also has this trigger, continue to execute. After is to execute the trigger of the previous level first, and then come back to execute it. What makes triggers difficult to understand is when each trigger is triggered and how it is used in development. All we know so far is pre-... , when-new-... -instance,when-... -validate,post-query and some on-... Trigger

Trigger execution order:

1. When opening FORM:

(1) PRE-FORM

(2) PRE-BLOCK (BLOCK level)

(3) WHEN-NEW-FORM-INSTANCE

(4) WHEN-NEW-BLOCK-INSTANCE

(5) WHEN-NEW-RECORD-INSTANCE

(6) WHEN-NEW-ITEM-INSTANCE

2. When the cursor moves to the next record after filling in a row of records:

(1) WHEN-VALIDATE-RECORD

(only verify the uniqueness of the filled records with the records that already exist in the database. If only the data on the page is duplicated and there is no duplicate value in the database, there will be no error.)

(2) WHEN-NEW-RECORD-INSTANCE

(3) WHEN-NEW-ITEM-INSTANCE

3. When you click "Save"

(1) WHEN-VALIDATE-RECORD

(all the data on the page is submitted to the database. If there is duplicate data on the page, the submission is successful the first time, but only the data is written to a place similar to a temporary table in the database, and an error is reported when the second duplicate record is submitted. If the transaction rollback is executed, the instructions that were executed successfully will also be undone.)

(2) PRE-INSERT

(3) ON-INSERT

(4) POST-INSERT

(5) POST-FORMS-COMMIT

(6) PRE-BLOCK (BLOCK level)

(7) KEY-COMMIT

(8) WHEN-NEW-ITEM-INSTANCE

4. When the cursor moves over a row that is already displayed in the current data block:

(1) WHEN-REMOVE-RECORD

(2) WHEN-NEW-RECORD-INSTANCE

(3) WHEN-NEW-ITEM-INSTANCE

When different ITEM moves on the line:

(4) WHEN-NEW-ITEM-INSTANCE

5. When a change is to be made (when a change is made on an item in the record):

(1) ON-LOCK

6. When saving after the modification is completed:

(1) WHEN-VALIDATE-RECORD

(2) PRE-UPDATE

(3) ON-UPDATE

(4) POST-FORMS-COMMIT

(5) PRE-BLOCK (BLOCK level)

(6) KEY-COMMIT

(7) WHEN-NEW-ITEM-INSTANCE

7. When deleting a record:

(1) ON-LOCK

(2) WHEN-REMOVE-RECORD

(3) KEY-DELREC

(4) WHEN-NEW-RECORD-INSTANCE

(5) WHEN-NEW-ITEM-INSTANCE

8.F11 query process:

(1) WHEN-CLEAR-BLOCK

(2) WHEN-NEW-RECORD-INSTANCE

(3) WHEN-NEW-ITEM-INSTANCE

After entering the query criteria, click CTRL+F11:

(4) PRE-QUERY

(5) WHEN-CLEAR-BLOCK

(6) POST-QUERY

(7) WHEN-NEW-RECORD-INSTANCE

(8) WHEN-NEW-ITEM-INSTANCE

9.CRRL+F11:

(1) WHEN-CLEAR-BLOCK

(2) PRE-QUERY

(3) WHEN-CLEAR-BLOCK

(4) POST-QUERY (trigger every time a record is checked)

(5) WHEN-NEW-RECORD-INSTANCE

(6) WHEN-NEW-ITEM-INSTANCE

10. When changing from query state (F11) to input state (F4):

(1) WHEN-CLEAR-BLOCK

(2) KEY-EXIT

(3) WHEN-NEW-RECORD-INSTANCE

(4) WHEN-NEW-ITEM-INSTANCE

11. Flashlight inquiry process:

(1) QUERY_FIND (BLOCK level)

After entering the query criteria, click the query button:

(2) WHEN-CLEAR-BLOCK

(3) PRE-QUERY

(4) WHEN-CLEAR-BLOCK

(5) POST-QUERY

(6) WHEN-NEW-RECORD-INSTANCE

(7) WHEN-NEW-ITEM-INSTANCE

12. When you click "New":

(1) WHEN-NEW-RECORD-INSTANCE

(2) WHEN-NEW-ITEM-INSTANCE

13. When you click "EditField":

(1) KEY-EDIT

14. When you click "WindowHelp":

(1) KEY-HELP

15. When you click "ClearRecord":

(1) WHEN-REMOVE-RECORD

(2) POST-QUERY

(3) WHEN-NEW-RECORD-INSTANCE

(4) WHEN-NEW-ITEM-INSTANCE

16. When you click F4 to close:

(1) KEY-EXIT

(2) POST-FORM

17. When you click the "CloseForm" button to close:

(1) KEY-EXIT

(2) POST-FORM

18. When you click the "Translations" button:

(1) TRANSLATIONS

19. When you click the small cross to close:

(1) WHEN-WINDOW-CLOSED

(2) CLOSE-WINDOW

(3) KEY-EXIT

(4) POST-FORM

20. Select the LOV list:

(1) KEY-LISTVAL

(2) WHEN-NEW-ITEM-INSTANCE

21. When the bar in front of the record is selected:

(1) WHEN-NEW-RECORD-INSTANCE

(2) WHEN-NEW-ITEM-INSTANCE (item level)

(3) WHEN-NEW-ITEM-INSTANCE

22. When the cursor moves up and down:

(1) WHEN-NEW-RECORD-INSTANCE

(2) WHEN-NEW-ITEM-INSTANCE

Tag tags: Oracle Form Builder trigger execution order

Triggers in Oracle Forms

Triggers are blocks of PL/SQL code that are written to perform tasks when a specific event occurs within an application. In effect, an Oracle Forms trigger is an event-handler written in PL/SQL to augment (or occasionally replace) the default processing behavior. Every trigger has a name, and contains one or more PL/SQL statements. A trigger encapsulates PL/SQL code so that it can be associated with an event and executed and maintained as a distinct object.

Block Processing Triggers:

Block processing triggers fire in response to events related to record management in a block.

When-Create-Record Perform an action whenever Oracle Forms attempts to create a new record in a block.

When-Clear-Block Perform an action whenever Oracle Forms flushes the current block; that is, removes all records from the block.

When-Database-Record Perform an action whenever Oracle Forms changes a record's status to Insert or Update, thus indicating that the record should be processed by the next COMMIT_FORM operation.

Interface Event Triggers:

Interface event triggers fire in response to events that occur in the form interface. Some of these triggers, such as When-Button-Pressed, fire only in response to operator input or manipulation. Others, like When-Window-Activated, can fire in response to both operator input and programmatic control.

When-Button-Pressed Initiate an action when an operator selects a button, either with the mouse or through keyboard selection.

When-Checkbox-Changed Initiate an action when the operator toggles the state of a check box, either with the mouse or through keyboard selection.

When-Image-Activated Initiate an action whenever the operator double-clicks an image item.

When-Image-Pressed Initiate an action whenever an operator clicks on an image item.

When-Radio-Changed Initiate an action when an operator changes the current radio button selected in a radio group item.

When-Window-Activated Initiate an action whenever an operator or the application activates a window.

When-Window-Closed Initiate an action whenever an operator closes a window with the window manager's Close command.

When-Window-Deactivated Initiate an action whenever a window is deactivated as a result of another window becoming the active window.

Master/Detail Triggers:

Oracle Forms generates master/detail triggers automatically when a master/detail relation is defined between blocks. The default master/detail triggers enforce coordination between records ina detail block and the master record ina master block. Unless developing custom block-coordination schemes, you do not need to define these triggers.

On-Check-Delete-Master Fires when Oracle Forms attempts to delete a record in a block that is a master block in a master/detail relation.

On-Clear-Details Fires when Oracle Forms needs to clear records in a block that is a detail block in a master/detail relation because those records no longer correspond to the current record in the master block.

On-Populate-Details Fires when Oracle Forms needs to fetch records into a block that is the detail block in a master/detail relation so that detail records are synchronized with the current record in the master block.

Message-Handling Triggers:

Oracle Forms automatically issues appropriate error and informational messages in response to runtime events. Message handling triggers fire in response to these default messaging events.

On-Error Replace a default error message with a custom error message, or to trap and recover from an error.

On-Message To trap and respond to a message; for example, to replace a default message issued by Oracle Forms with a custom message.

Validation Triggers:

Validation triggers fire when Oracle Forms validates data in an item or record. Oracle Forms performs validation checks during navigation that occurs in response to operator input, programmatic control, or default processing, such as a Commit operation.

When-Validate-Item

When-Validate-Record

Navigational Triggers:

Navigational triggers fire in response to navigational events. Navigational triggers can be further sub-divided into two categories: Pre- and Post- triggers, and When-New-Instance triggers. Pre- and Post- Triggers fire as Oracle Forms navigates internally through different levels of the object hierarchy. When-New-Instance-Triggers fire at the end of a navigational sequence that places the input focus ona different item.

Pre-Form Perform an action just before Oracle Forms navigates to the form from "outside" the form, such as at form startup.

Pre-Block Perform an action before Oracle Forms navigates to the block level from the form level.

Pre-Record Perform an action before Oracle Forms navigates to the record level from the block level.

Pre-Text-Item Perform an action before Oracle Forms navigates to a text item from the record level.

Post-Text-Item Manipulate an item when Oracle Forms leaves a text item and navigates to the record level.

Post-Record Manipulate a record when Oracle Forms leaves a record and navigates to the block level.

Post-Block Manipulate the current record when Oracle Forms leaves a block and navigates to the form level.

Post-Form Perform an action before Oracle Forms navigates to "outside" the form, such as when exiting the form.

When-New-Form-Instance Perform an action at form start-up. (Occurs after the Pre-Form trigger fires).

When-New-Block-Instance Perform an action immediately after the input focus moves to an item in a block other than the block that previously had input focus.

When-New-Record-Instance Perform an action immediately after the input focus moves to an item in a different record.

When-New-Item-Instance Perform an action immediately after the input focus moves to a different item.

Transactional Triggers:

Transactional triggers fire in response to a wide variety of events that occur as a form interacts with the data source.

On-Delete

On-Insert

On-Update

On-Logon

On-Logout

Post-Database-Commit

Post-Delete

Post-Insert

Post-Update

Pre-Commit

Pre-Delete

Pre-Insert

Pre-Update

Query-Time Triggers:

Query-time triggers fire just before and just after the operator or the application executes a query in a block.

Pre-Query Validate the current query criteria or provide additional query criteria programmatically, just before sending the SELECT statement to the database.

Post-Query Perform an action after fetching a record, such as looking up values in other tables based on a value in the current record. Fires once for each record fetched into the block.

Open, close, create, and update the trigger order of records

PRE-...

Triggered when entering a form or navigating to a new block, PRE-... Series of triggers are usually in WHEN-NEW-. Before the INSTANCE series, if they failed, they could not successfully navigate to the next object and had to stay in the current location. In these triggers, you can set some judgment conditions to limit whether you can navigate to a new location.

WHEN-NEW-... -INSTANCE

This type of trigger is triggered every time the mouse cursor falls over a new block,record,item, and even if it fails, there will be no error. However, when-new-form-instance is triggered only when the form is started, when the cursor navigates to the first navigation item of the first navigation block, and if an application has more than one form, it is not triggered when the cursor is switched between form.

POST-TEXT-ITEM and WHEN-VALIDATE-ITEM

Trigger point of Post-text-item: when the input cursor is transferred from one Text-Item to another item, you can use it to change the value of item. Although when-Validate-item is also triggered before leaving, the function is different. Post-Text-Item itself has no verification, and when-Validate-item can be used to supplement some verification (in addition to the verification of form itself), but when form verification is successful. The item will be marked 'valid',' instead of validating, and if we modify its value at this time, it is possible to import invalid values into the database. When you create and update a record, you trigger when-Validate-item, then Post-Text-Item, then when-Validate-record.

POST-... Series are triggered when leaving the current block,record,item

WHEN-WINDOW-ACTIVATED

When you modify the raw material properties of the platform, use this trigger for the first time to refresh the current window when returning from another window, and the code is written in this trigger. I tried it with fnd_message.debug before using it, and after opening the window, I kept popping up message. As long as the window keeps executing the code that triggers it during the activity, the code that is executed should be limited by if conditions.

The priority of Trigger for Form is from item to block to form level, and if the Execution Hierarch property (override,before,after) is set separately, it will be executed in the order in which it is set. If it is override, then after executing this level of trigger, it will not be executed upwards. Before means that after executing this level of trigger, if the previous level also has this trigger, continue to execute. After is to execute the trigger of the previous level first, and then come back to execute it. What makes triggers difficult to understand is when each trigger is triggered and how it is used in development. All we know so far is pre-... , when-new-... -instance,when-... -validate,post-query and some on-... Trigger

Verify the difference between the code written in WHEN-VALIDATE-RECORD and PRE-INSERT

Verify the difference between the code written in WHEN-VALIDATE-RECORD and PRE-INSERT

1. If you write it in WHEN-VALIDATE-RECORD, you can prompt the error message in time. If you want to associate with the backend database during verification, you should write it in PRE-INSERT, because PRE-INSERT,ON-INSERT is executed one by one, so that when you enter a batch, the verification of each record can get the latest database record.

2. If one PRE-INSERT entry is not successful in batch entry, all records cannot be saved successfully.

The relationship between Post-Query and When-New-Record-Instance

Post-Query and When-New-Record-Instance

Assuming that there are 100 records in the database and the number of rows displayed in the block setting is 10, when the cursor moves between the displayed records, only When-New-Record-Instance is triggered, not Post-Query. Post-Query is triggered when the cursor moves over the eleventh record

When-validate-item use of invisible item

Question: if an item is invisible, will changing its value still trigger when-validate-item?

The result: triggers, but not after changing its value, but when the cursor moves to another block. It is also triggered when the window is closed.

Test: set the item1 of block1 to be invisible, assign a value to tem1 in the when-validate-item of item2, at run time, after changing the value of item2, moving the cursor between the item of block1 does not trigger the when-validate-item of item1 until the cursor leaves the block, or closes the window.

ACCEPT Trigger explanation

ACCEPT APP_STANDARD.EVENT ('ACCEPT'); this trigger handles the call to the Save and Proceed (Save and continue) action on a menu or toolbar. It performs a save and moves to the block specified as the first navigation block. Replace the code in this trigger, or create a block-level trigger and specify the execution type as' Override'

FOLDER_RETURN_ACTION

FOLDER_RETURN_ACTION

This trigger allows you to specify the folder event of the customer China.

Replace with the required code to handle the folder action

KEY_DUPREC

APP_STANDARD.EVENT ('KEY-DUPREC')

This trigger disables the default duplicate record function of Oracle forms

KEY-CLRFRM

KEY-CLRFRM

APP_STANDARD.EVENT ('KEY-CLRFRM')

This trigger validates the record before attempting to empty the form

Add additional code after the original code, usually you should add GO_BLOCK if there are multiple areas in the form, use GO_BLOCK to repopulate the control menu after calling the empty from operation

KEY_MENU

KEY_MENU

APP_STANDARD.EVENT ('KEY-MENU')

This trigger disables the Oracle froms Block Menu command

To enable keyboard operation from a specific block pair of substituted blocks, the trigger to write a block-level KEY_MENU and set the execution type to 'Override' opens the same LOV as the pop-up menu

KEY_LISTVAL

KEY_LISTVAL

APP_STANDARD.EVENT ('KEY-LISTVAL')

This trigger performs elastic domain operations or references LOV

Create a block or item-level trigger and set the execution type to 'Override',. You can use calendar or dynamically execute elastic fields

ON-ERROR

ON-ERROR

APP_STANDARD.EVENT ('ON-ERROR')

This trigger handles all errors on the server or client, using message dictionary calls.

To catch and handle the specified error, check the specified error declare before calling APP_STANDARD

Original_mess varchar2 (80)

Begin

IF MESSAGE_CODE = THEN

Original_mess: = MESSAGE_TYPE | |'-'| |

To_char (MESSAGE_CODE) | |':'| | MESSAGE_TEXT

-your code handling the error goes here

Message (original_mess)

ELSE

APP_STANDARD.EVENT ('ON_ERROR')

END IF

End

POST-FORM

POST-FORM.

APP_STANDARD.EVENT ('POST-FORM')

This trigger is reserved for later use

Add additional code after the original code.

PRE-FORM

PRE-FORM

FND_STANDARD.FORM_INFO ('$Revision: $'

''

''

'$Date: $'

'$Author: $')

APP_STANDARD.EVENT ('PRE-FORM')

APP_WINDOW.SET_WINDOW_POSITION ('BLOCKNAME'

'FIRST_WINDOW')

This trigger initializes the internal values and menus of the Oracle application. The value entered here will be seen in the Oracle application menu 'Help About Oracle Applications'.

You must edit the acronym of the application, which controls which application's online help document will be called when the user selects the 'help' button. If you set the app's acronym to FND, your users will not see any help because the Oracle application will not be able to create available help targets.

The name of the Form is the user form name (form title).

Oracle uses the source control system, which automatically updates values that start with "$". If you don't use the source control system, you can edit these values according to your development information.

You must edit BLOCKNAME in APP_WINDOW for your own block. Do not edit FIRST_WINDOW

QUERY_FIND

QUERY_FIND

APP_STANDARD.EVENT ('QUERY_FIND')

This trigger will set the display string 'Query Find is not available'

Instead of code in this trigger, create a block-level trigger when you create a window or Row_LOV in your form and set the execution type to 'Override'

WHEN-NEW-FORM-INSTANCE

WHEN-NEW-FORM-INSTANCE

FDRCSID ('$Header:... $')

APP_STANDARD.EVENT ('WHEN-NEW-FORM-INSTANCE')

-- app_folder.define_folder_block ('template test'

'folder_block', 'prompt_block',' stacked_canvas'

'window',' disabled functions')

-- app_folder.event ('VERIFY')

APP_STANDARD.EVENT is called to call FND_FUNCTION.EXECUTE in query-only mode, and FNDRCSID is called for the source control system (source control system) of the Oracle application. APP_FOLDER is only called within the Oracle application. Custom form does not require FDRCSID or APP_FOLDER calls, but it does not matter if you leave them in the trigger.

Add additional code before the existing code.

WHEN-NEW-RECORD-INSTANCE

WHEN-NEW-RECORD-INSTANCE

APP_STANDARD.EVENT ('WHEN-NEW-RECORD-INSTANCE')

This trigger manages Oracle application menus and toolbars

Create a block-level trigger and set the execution type to 'Before'

WHEN-NEW-ITEM-INSTANCE

WHEN-NEW-ITEM-INSTANCE

APP_STANDARD.EVENT ('WHEN-NEW-ITEM-INSTANCE')

This trigger manages menus and toolbars for Oracle applications

If you add an elastic domain method call, you should add it to be called before the APP_STANDARD.EVENT call. Normally, you should not add any code to this trigger, which will affect the speed of your form and affect each item.

Oracle EBS Form. Trigger that cannot be modified in the

Oracle applications do not support modifying form-level triggers

CLOSE_THIS_WINDOW

Invoke the trigger APP_CUSTOM.CLOSE_WINDOW from the menu Action- > Close.

CLOSE_WINDOW

APP_CUSTOM.CLOSE_WINDOW (: SYSTEM.EVENT_WINDOW)

This starts it to handle all events that close the window. Writing events that handle closing the window must be written in the APP_CUSTOM.CLOSE_WINDOW package

EXPORT

App_standard.event ('EXPORT')

This trigger is selected from the "Action,Export" menu.

FOLDER_ACTION

App_folder.event (: global.folder_action)

KEY-COMMIT

App_standard.event ('KEY-COMMIT')

This trigger handles normal commit or form calls

KEY-EDIT

App_standard.event ('KEY-EDIT')

This trigger handles elastic fields or calendars, editor operations.

KEY-EXIT

App_standard.event ('KEY-EXIT')

This trigger handles the close event and exit enter-query status

KEY-HELP

App_standard.event ('KEY-HELP')

This trigger calls the window's help system.

LASTRECORD

APP_STANDARD.EVENT ('LASTRECORD')

This trigger handles menu (Go-> LAST RECORD) events

MENU_TO_APPCORE

App_standard.event (: global.menu_to_appcore)

This trigger supports the Special menu

STANDARD_ATTACHMENTS

Atchmt_api.invoke

This trigger handles calls to attachment menus or tool buttons

WHEN-WINDOW-CLOSE

Execute_trigger ('CLOSE_WINDOW')

This trigger centralizes the form shutdown event

WHEN-FORM-NAVIGATE

You cannot modify this trigger, it contains standard behavior and normalizes the minimized form when it is navigated to.

ZOOM

Appcore_custom.event ('ZOOM')

This trigger handles the menu or toolbar button 'Action,Zoom' event.

Thank you for your reading, the above is the content of "what is the execution order of Oracle Form triggers". After the study of this article, I believe you have a deeper understanding of the execution order of Oracle Form triggers, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report