For Every Record
This action executes subordinate nested actions multiple times. All of the nested actions are executed in a loop as many times as there are records in the form table with a connected database.
You can use all records or selected records to execute subordinate nested actions.
About group identifies the selected action.
- Name: allows you to define a custom action name. This makes actions easily recognizable on the solution's list of actions. By default, the action name is taken from its type.
- Description: custom information about the action. Enter a description to explain the purpose and role of action in a solution.
- Action type: read-only information about the selected action type.
The Settings group selects the records.
-
Form table: form table that contains records for which action should repeat.
-
Use all records: repeats an action for all records in a defined table.
-
Use selected record: repeats an action for the selected records only.
If you use the action Execute SQL Statement with enabled option Iterate for Every Record, Loftware automatically inserts For every Record action. A note appears about the automatic mapping of your variables.
Prompt variables on your label automatically connect to your database fields with the same names. See the instructions on how to create your solutions:
Important
When you create your solution with a database connection, use prompt variables on your labels instead of database fields.
Use the same names for prompt variables as are defined for database fields, for example:
Database field: food_products_1c.ProdCode
Prompt variable on your label: ProdCode
Loftware then automatically maps corresponding variables with database fields.
Example 121. Example
Your solution is connected to your database. You want to print selected records on your labels.
Use action For Every Record and nest actions to print your labels. Select the Use selected records option.
Select the records in your database table on your printing form, then print your labels.
Action Execution and Error Handling
Each action can be set as a conditional action. Conditional actions only run when the defined conditions allow them to be run. To define these conditions, click Show execution and error handling options.
Execution options are:
- Enabled: specifies if the action is enabled or disabled. Only enabled actions will execute. This functionality may be used while testing a form.
- Condition: defines one-line programming expression that must provide a Boolean value (true or false). When the result of the expression is true, the action will execute. Condition offers a way to avoid executing actions every time.
Error handling options are:
- Ignore failure: specifies whether an error should be ignored. If enabled, the execution of actions continues even if the current action fails.
Note
Nested actions that depend on the current action do not execute in case of a failure. The execution of actions continues with the next action on the same level as the current action. The error is logged but does not break the execution of the action.
- Save error to variable: allows you to select or create a variable to save the error to. The same cause of the error is also saved to internal variables ActionLastErrorId and ActionLastErrorDesc.
At the end of printing, you might want to send the status update to an external application using the HTTP Request action. If the printing action fails, action processing stops. In order to execute the reporting even after the failed print action, the Print Label action must have the option Ignore failure enabled.