Table of contents



Official Content

Rules provide a generic language to enforce controls in Transaction objects. These rules can be applied in Work Withs as well (remember Transactions will be executed as web services Business Components).

Behavior

When the insert, update or delete actions are executed from the WWSD Detail, is the Transaction as Business Component what is called. So, those Transaction rules not involving the Web Form will be executed, getting messages into the Messages SDT, that are later processed by the Work With in order to show the corresponding information into the Native Mobile application. For instance:

Error

This rule is triggered when the user taps "Save" on the Transaction. If the condition of the error Rule is true, then a pop-up message like the following will appear.

ErrorRuleSmartDevices

NoAccept

Disables you to enter a value attribute field, as shown in the image.

NoAcceptRuleSmartDevice

This rule assigns values or formulas/expressions to an attribute, for example:

AssignmentRuleSmartDevicesTRN

AssignmentRuleSmartDevices1AssignmentRuleSmartDevices2

Default

Assigns a default value to an attribute or variable at Insert time.

RulesSmartDevicesDefaultTRN

As shown in the image below, fields are filled upon executing the insert operation.

RulesSmartDevicesDefault

Add

Adds two attributes if the condition evaluates to True. In the next example below, you have the following rule: "Add(Numeric1,Numeric2);" and, as pictured, numeric2 is disabled.

After tapping on "Save", the rule is executed and adds the value from "Numeric1" to "Numeric2".

AddRuleSmartDevice1 AddRuleSmartDevice2

Subtract

Subtracts the value of an attribute from another attribute, depending on a condition. In the example below, you have the rule "Subtract(Numeric1,Numeric2);" and, as pictured, numeric2 is disabled.

After tapping "Save" the rule is executed and subtracts the value from "Numeric1" from "Numeric2".

SubtractRuleSmartDevice1 SubtractRuleSmartDevice2

Call

Calls a GeneXus object, passing attributes/variables as parameters. Parameters may be attributes, variables or constant values.



Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant