Defining Flex business rules - HxGN EAM - 12.0.1 - Help - Hexagon

HxGN EAM Help

Language
English
Product
HxGN EAM
Search by Category
Help
HxGN EAM Version
12.0.1

Define Flex business rules or SQL statements to define validation rules that are specific to your organization. You can set up one or more statements to be processed for post-insert or post-update events.

Flex SQL processing supports data query (select) and data manipulation (insert, update, delete) statements. Use select statements to perform a check condition.

Uppercase and lowercase characters are allowed in the SQL statement. The row identifier token, however, must be either all uppercase or all lowercase (such as :ROWID or :rowid).

Every Flex SQL statement requires the use of a predefined :ROWID token. This token refers to the database row identifier for the record being processed in the specified table. The statement is executed for each record in the table affected by the insert or update operation.

The maximum statement length is 4000 characters. No statement termination character (;) is required.

Data manipulation statements are allowed, but make sure you do not begin an infinite cascading of trigger steps. For example, generally it is not recommended to create a Flex SQL statement that updates the base table identified in Table.

HxGN EAM recommends that you define Flex SQL procedures in close cooperation with your HxGN EAM consultant.

  1. Select Administration > Setup > Flex Business Rules form.

  2. Click New Record.

  3. Specify this information:

    Table - Specify the database table.

    Sequence Number - Specify the sequence number for the Flex SQL statement.

    Trigger - Select one of the following options:

    • Post Insert

    • Post Update

      SQL Statement - Specify the SQL statement for the selected database table.

      Failure Message - Specify the failure message.

      Comments - Specify comments regarding the Flex SQL statement.

  4. Optionally, select the Must Exist check box if the Flex SQL statement must exist in the database table. If Must Exist is selected, SQL statements are run in order of Sequence Number. If one statement fails, the remainder do not run. If Must Exist is not selected, each statement runs separately.

  5. Optionally, select the Abort on Failure to abort the statement upon failure. If Abort on Failure is checked, the Failure Message field value is returned, any remaining SQL statements are not processed, and the save that triggered the flex SQL is canceled.

  6. Optionally, select the Reverse Return Code check box to automatically reverse the returned value upon statement completion, for example, Null becomes Not Null. Reverse Return Code is used only with Abort on Failure.

  7. Optionally, select the Active check box to set this Flex SQL statement record to active.

  8. Click Save Record.

    • Records flagged as Mobile Only cannot be deleted on this screen. You must delete them on the mobile device.

    • Click Test Flex SQL to check the validity of the SQL statement.