The Add Transaction Fields trigger A trigger is a SQL procedure that performs an action when a transaction (INSERT, UPDATE, DELETE) occurs. You can use triggers to perform validation of input data, to automatically generate a value for a newly inserted row, to read from other tables for cross-referencing purposes, or to support alerts through e-mail messages. allows the adding of fields that do not appear in the form on page, but are taken into account when inserting the new record into the table (as they are present in the database A database refers to data organized and stored on a computer that can be searched and retrieved by a computer program. Most industrial-strength and many smaller database applications can be addressed using SQL (Structured Query A query is a SQL command that will extract information from the tables of a database. Essentially, a query is a request for information from your database. Language).).
It is a BEFORE trigger, and therefore it gets executed before the actual Insert/Update/Custom Transaction, but after the page has been submitted. This way, in order to compute the transaction field's value, other fields from the form can be used. Also, this trigger is executed after the validation has been performed, which guarantees that only coherent and correct data is taken into account.
As an example on where it can be used, consider the insert page for adding a new product into a database table. The table contains both price and price_with_taxes columns, but only price is requested in the form. To add the second price, you can use an Add Transaction Fields trigger which will compute the second price based on the value submitted with the form for the regular price.
To add an Add Transaction Fields trigger to your page, follow the next steps:
To set the dialog box options, follow the next steps:
The three buttons in the top right corner of the interface offer you the next functionalities:
· Click OK when you are done configuring the trigger.
· Click Cancel to exit without applying the new settings.
· The Help button opens this help page.
These buttons are common to both tabs of the Add Transaction Fields
This step of the configuration requires the user to set the trigger's name and some transaction options:
To set the dialog box options, follow the next steps: