Conditional action
Use the Conditional action to tell the system that if one condition is true, the logic block should do one action, and if the condition is false, the logic block should do a different action.
The Conditional action compares two values and performs other actions based on whether the condition(s) is true or false. Some may refer to this as an IF statement or an IF/Else Statement.
Add one or more conditional expressions for the comparison. The comparison can be between different value types, such as field to field, constant to field, variable to field, variable to variable, etc. You can also compare System Logic Block Modes and do expressions on a table. As of now, constants cannot be on the left hand side of an expression.
Expressions can be grouped using AND or OR statements. If several expressions are grouped together by an AND statement, it only evaluates to true if they are all true. If they are grouped together by an OR statement they evaluate to true even if only one of them is true. Anytime an expression or grouping of expressions does not evaluate to true, it evaluates to false, so similarly, in a grouping of expressions using AND, one false expression will evaluate the entire group to false, however, in an OR grouping, they must all be false for the group to be false.
Groups of expressions can be nested inside of other groups, and they will function the same as an expression, being evaluated based on their final true/false value.
See the Conditional actions best practices topic for more information.
Loop List action
The Loop List action gives application developers the ability to loop through messages in a message list or entries within a record or value list.
Message lists
Message lists can include:
- The current logic block's message list.
- Any message list created from a Call A Logic Block action.
Each time the logic block loops through the message list, a message matching the specifications for the LBErrorWarningTable is made available in order to inspect the message attributes such as type, severity, and source.
Record and value lists
Lists can contain either records or values and are created in the logic blocks Inputs and Outputs subtable, or with the Create List action.
When you loop over a record list the output is a DSN which can be referenced in other logic block actions. When you loop over a value list the output is a new variable.
Learn more in Logic block lists.
Loop Multiple Selections action
The Loop Multiple Selection action is used to process values in a multiple selection list lookup field.
Use this action to:
- Retrieve multiple selection field values, so they can be acted on individually within the loop.
- Loop through each selected field value and act on them.
- Count the number of values in the field.
A multiple selection field is a list lookup field in which you can select multiple values. List lookup fields in applications are stored as data items that are associated with a list lookup definition. When one of these data items is used by a logic block without using a Loop Multiple Selection action, it is handled as a text data item and all the selected values are strung together and treated as a single text value. That is, the different values in the field are not seen as individual values. To access the selected values, you must use a Loop Multiple Select action. Actions outside of the loop, only have access to the last selected value that was looped over.
Call a Logic Block action
Use the Call a Logic Block action to define a processing logic block that runs and updates information before passing it back to a calling logic block.
When you use a Call a Logic Block action, you use the calling logic block to pass information to a processing logic block. Any data sources specified as inputs in the processing logic block are passed to the calling logic block. When the processing logic block runs, it uses that information, modifies it, and then passes updated information back to the calling logic block. The calling logic block uses the updated information in other actions. By default, the processing logic block doesn’t save the result of its processing, it just passes it back to the calling logic block.
You can use the Run in New Database Transaction checkbox to have the processing logic block run in a new transaction. If the new transaction is run live, the triggers are run immediately. If the new transaction is in a NATE container, the updates become pending and the triggers run when the transaction commits at the end.
If the processing logic block finishes successfully, the new transaction is committed. The changes from the processing logic block are then fully committed into the database and control is returned to the parent where it resume operation in its own transaction.
You can specify which fields you want to pass from the calling logic block to the processing logic block, or you can specify an entire table.
Logic block call mode and record disposition
The logic block call mode dictates what user actions initiate the logic block. For example, a logic block with a call mode of Create only initiates when a user creates a record.
You can dictate the call mode of processing logic blocks in the Call a Logic Block action. Optionally, you can then conditionalize the call mode with the Logic Block Mode system value. For example, if you have a trigger that runs on both insert and update operations, you could create conditionals which check if the Logic Block Call Mode is Create or Edit. This would ensure the logic block only initiates on one of those states which allows you to use shared logic in multiple scenarios.
Processing logic blocks initiated by a user interaction within an application are assigned a call mode based on the record disposition. The record disposition is managed by the platform, and tracks the current state of the record within a given NATE container. For example, a record that is being updated would have a record disposition of MODIFIED and would assign the call mode of Edit to the logic block. A record within the NATE container that hasn't been impacted by the transaction would have a record disposition of PRISTINE.
The table below reviews the available call modes and the associated user actions:
| Call Mode | User action |
|---|---|
| Create | Create a record |
| Edit | Change an existing record |
| Delete | Delete a record |
| Current | Create a record Change an existing record Delete a record |
If you want to always call the processing logic block as part of the calling logic block, use the Current call mode. The Current logic block call mode runs the processing logic block in whatever mode the calling logic block is currently running in. In other words, use the Current call mode if you want the processing logic block to run every time the calling logic block runs.
Adopt All Messages
The Adopt All Messages checkbox is selected by default and allows for all messages from a processing logic block to execute as part of the current logic block. Any errors on a processing logic block interrupt the current logic block.
To create a specific message list instead, clear the checkbox and enter the message list name in the field that populates. Any errors or other messages that occur when your logic block runs go into the message list you created instead. Clearing this checkbox indicates that the calling logic block throws its own error in response to errors in the processing logic block, or does not care about any errors thrown by the processing logic block.
Additional Mappings
Additional mappings allows you to pass in values from fields that weren't defined at the time of design, such as Customer defined attributes (CDAs), Extension fields, or Customized fields. See Additional mappings in logic blocks for more information.
Log Messages (Deprecated)
Select the Log Messages checkbox to create a log of messages generated by the processing logic block. This log does not display in the application.
You can access values in the log using a Fetch Messages action.
On Error (Deprecated)
Specify an On Error action to set the action that runs when an error occurs in the processing logic block. Usually this action calls another logic block or sets an error message. If there isn't an action in the On Error branch, the calling logic block continues to run, and any errors from the processing logic block don't display in the application.
An Interrupt With Error action stops the calling logic block execution and displays a message to the user.
You can access the values in the error message record fields when you use a Set Value action. When you do, the values display in a field in the application, but not the entire error. These fields include Field, DataItemName, InternalSeq, LogicBlock, MessageDescription, and MessageType.
If an error occurs when the processing logic block runs, any changes made by the processing logic block are discarded. However the calling logic block continues to run if there are no actions defined in the On Error branch.
Call a Logic Block – Dynamic action
Application developers use the Call a Logic Block - Dynamic action to call logic blocks that, instead of being specified in a Call a Logic Block action, are dynamic values entered in the application by the user. That is, a field value in a record or a variable created in the calling logic block can be used to specify the processing logic block.
Use the Input field of the action to configure how the processing logic block is determined. Generally this can either be a field in a record or the result of another logic block. For example, if there is a field in an application where a user can enter the name of a logic block, you can use that field value to determine the called logic block in the Call a Logic Block - Dynamic action.
In the Call a Logic Block - Dynamic action you enter the table that called logic blocks must be built over in order to run. If the called logic block that is entered is not built over the table you enter, it won't run.
When the user enters a name of a logic block that is not built over the specified table, they receive an error when the Call a Logic Block - Dynamic action runs. Generally the user entering the name of a logic block to call knows what logic block to call or have access to view logic blocks.
Like the Call a Logic Block action, you configure:
- The Logic Block Call Mode to determine when the logic block is called. Learn more in Call a Logic Block action.
- The Name of the data source for this action, which you use to reference the resulting data source in later actions.
- The Data Source Name to pass in to the called logic block.
Interrupt With Error action
Application developers use the Interrupt With Error action to set an error and interrupt the execution of a logic block.
This action is similar to the Create Message action. However, you will not have the ability to set the severity of the message or map from a pre-existing message since the severity level must always be error for this action. When the Interrupt With Error action is triggered during the execution of a logic block, the message will be created, added to the current logic block’s message list, and execution will immediately be interrupted.
Once the logic block is done executing, the field associated with the error message in the error source section is highlighted.
Refresh logic block actions
Use the Refresh Record and Refresh in Transaction Boundary actions to trigger a full refresh of the display once all other actions in the logic block have completed.
Each refresh action is useful for different scenarios.
Refresh Record action
The Refresh Record action refreshes the display, but discards any changes made after the logic block was initiated. It can be used in both the Detail and List form of an application.
Refresh in Transaction Boundary action
The Refresh in Transaction Boundary action refreshes the display, but retains any unsaved changes to the records within the transaction boundary. This is useful when the logic block makes changes which you want the triggering user to see on their screen, but you don’t want any of their unsaved changes to be lost. For example, when you make a change in the Header and want to refresh the Detail form, or if you make a change in an inline application and want to refresh the parent application.