Add Transaction Fields

The Add Transaction Fields trigger 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).

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:

  1. Access the trigger from the Application panel, Server Behaviors -> + -> MX Kollection -> Forms -> Advanced -> Add Transaction Fields.
  2. Complete the dialog box that pops-up, following the instructions below for each of the two tabs:
    · The Basic tab
    · The Advanced tab
  3. Click OK when done.

The Basic tab

In the first step of the dialog box you should select the fields to be added, and specify their type and value:

 

To set the dialog box options, follow the next steps:

  1. In the Columns area specify the table columns you want to add to your HTML form from the insert page. You can add columns using the Plus (+) button. The Minus (-) button is used to remove fields from the form.


                       
  2. Specify the required settings for each added data-entry in the HTML form by selecting a row (single click) in the Columns area and entering the required information in the boxes below the grid. Read along for instructions.
  3. In the Type drop-down menu select the data format accepted by your database table. All the options that you have are listed here: Text, Numeric, Double, Date.
  4. In the Value text box specify the value for the selected table column. You can use the InterAKT Dynamic Data (the lighting bolt icon) to build complex expressions.
  5. 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 trigger.

  6. Click on the Advanced tab to continue with configuring the trigger.

The Advanced tab

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:

  1. In the Trigger name text box enter an identifier (a name) for the trigger. Be careful when choosing it, because it has to be unique on each page since it is also the function name. By default, MX Kollection 3 assigns unique names to each trigger, and this setting should not be changed, unless you really know what you are doing.
  2. In the Transactions area, the transactions to which the trigger is registered are displayed. You can add new transactions manually, by using the Plus (+) button:



    The Minus (-) button is used to remove transactions from the grid (select the transaction first, with a single click).
    At least one transaction must be in the area at all times.
  3. Specify the required settings for each transaction listed above by selecting a row (single click) in the Transactions area and entering the required information in the boxes below the grid. Read along for instructions.
  4. In the Priority text box specify the trigger's priority to execute when working with the currently selected transaction from the grid. The higher the value is, the later it will be executed.
  5. In the Type drop-down menu you can read the trigger type. The drop-down menu appears disabled because it is a read-only field. The allowed trigger type in this situation is BEFORE, but all the possible trigger types are: STARTER, BEFORE, AFTER, END, ERROR.
  6. In the Condition text box specify the condition that has to be fulfilled for the trigger to be executed (the start condition). To create the condition in a visual manner, click the Build condition button. It will open the Condition Builder dialog box.
  7. After configuring the user interface, click OK to apply the trigger, or Cancel to dismiss it without making any changes to your page.