Controls, Actions, and Triggers
Loading a form, clicking a button, selecting an option from a drop-down list, or submitting text via a prompt is an event that can serve as a trigger A means of running an action, rule, or data service. Includes a trigger source if interactive (such as a button, a prompt, or a form) and a trigger event (such as clicking a button, entering text at a prompt, loading a form, or submitting a job). For example, you can specify a particular button as a trigger source that Data Providers can click to perform a query of a database. to run a label data source
An item that specifies the origin of data used to fill variable fields in a label template. Types of label data sources are displayed in the Data Sources pane in Label Design., an action
Provides a form or an application with enhanced functionality. An action or rule can add or change data or print parameters, submit a print request, validate user credentials, open a label template, form, layout, image, reusable object, or application, open a URL in a web browser, or close an application. Actions and rules are similar to business rules, but simpler to create. They are created in Application Design and are specific to a particular application or form. Some actions are available only in applications., or a business rule
A collection of component sets or business rule components that can be used to incorporate logic or to add, change, or remove data or print parameters after a print request is submitted but before printing occurs. Business rules are similar to form rules, but provide more robust functionality. Business rules are created on the Application Design page and can be designed using the Configurator or programmed using XML..
In Label Design
- While you are configuring a data source, you can configure triggers that can be used to run the data source. This approach is convenient if you want to use an existing Button
A type of control or document field in the data entry view of a label template or in a form that can be used to run a data source query, a form rule, or a business rule when clicked by a Data Provider. field, an existing Prompt
A type of control or document field used to collect information from a Data Provider in the data entry view of a label template or in a form. When a Data Provider submits data via a prompt, a data source query, a form rule, or a business rule may be run. field, a form
The interface for data entry by a data provider. A form is a separate object in Loftware, but it can be combined with a label template so that the form serves as the Form view for the label template., or the Form view
The portion of a label template that includes any interface for data entry by a data provider. It can be configured in the Form view in Label Design. of the label template as a trigger source
A field that is used in conjunction with a trigger event to interactively run an action, rule, or data service. For example, a button that runs a query when clicked, a prompt that runs a query when submitted, or a form that runs a query when loaded..
- While you are configuring a Button field, a Prompt field, a form, or the Form view of a label template, you can configure that item to be a trigger source for a data source. This approach is convenient if the data source was created before the trigger source existed, or if you are not familiar with the name of the trigger source.
You can also configure triggers for form rules and business rules. You can use any of the following approaches to select a trigger for a rule.
- While you are configuring an application, you can configure triggers that can be used to run a rule. You can associate a trigger with the loading of the application or with the loading of a specific form. This approach is convenient if you want to use an existing form or the Form view of a label template as a trigger source.
- While you are configuring a form, you can configure triggers that can be used to run a rule or data source. This approach is convenient if you want to use an existing form or the Form view of a label template as a trigger source. You can also use controls in the form, such as Button fields and Prompt fields, as trigger sources.
- While you are configuring a control field in a form, you can configure triggers that can be used to run a rule or data source. This approach is convenient if you want the click of a button, the selection of an option, or the submission of text to act as the trigger to run a form rule, business rule, or data source.
- If you design business rules by using the Configurator in Application Design
- If you program business rules by using XML in Application Design
In addition to being associated with a data source, action, or rule, each trigger in Label Design A field that is used in conjunction with a trigger event to interactively run an action, rule, or data service. For example, a button that runs a query when clicked, a prompt that runs a query when submitted, or a form that runs a query when loaded., trigger event
An event that is used in conjunction with a trigger source to run an action, rule, or data service. For example, clicking a button, entering text at a prompt, loading a form, or submitting a job., priority
The order in which actions, rules, or data services that have otherwise identical triggers are run. Priority values are compared only if the actions have the same trigger source, trigger event, and trigger key (if any). The type of trigger source is irrelevant. Among actions, rules, or data services with otherwise identical triggers, the trigger source with the lowest value for priority is run first., and in some cases a trigger type
Whether the trigger is for an action, rule, or data service. or a trigger key
The name of a data map entry used as part of a data source trigger that has a Do Not Run trigger source. If the trigger key exists in the data map, then no trigger is permitted to run the data source. If the trigger key does not exist, then other triggers can run the data source. In either case, the value of the data map entry is not relevant.. Triggers do not have names, so when viewing a list of triggers associated with a particular data source, action, or rule, they are differentiated by trigger source. When viewing a list of triggers associated with a particular trigger source, they are differentiated by data source or rule.
Controls
The following controls can be used if a label template is intended to support on-demand printing.
Trigger Source Type | Trigger Event | Description |
---|---|---|
Button field |
onClick |
The onClick event occurs when the Button field specified as the Trigger Source is clicked by an interactive user in Print |
Check Box field |
onChange |
The onChange event occurs when the Check Box field specified as the Trigger Source is selected or cleared by an interactive user in Print |
Drop-Down List field |
onChange |
The onChange event occurs when an interactive user in Print |
Device Selector field |
onChange |
The onChange event occurs when an interactive user in Print |
Folder Selector field |
onChange |
The onChange event occurs when an interactive user selects a folder by using the Folder Selector field specified as the Trigger Source. |
Label Selector field |
onChange |
The onChange event occurs when an interactive user selects a label by using the Label Selector field specified as the Trigger Source. |
Radio Button Group field |
onChange |
The onChange event occurs when an interactive user in Print |
Prompt field |
onFocusOut |
The onFocusOut event occurs when an interactive user in Print |
User Selector field |
onChange |
The onChange event occurs when an interactive user selects a user by using the User Selector field specified as the Trigger Source. |
Text Box Prompt field |
onFocusOut |
The onFocusOut event occurs when an interactive user in Print |
Table field |
onDoubleClick |
The onDoubleClick event occurs when an interactive user in Print |
Application | onLoad |
The onLoad event occurs when the application specified as the Trigger Source is loaded in Print Note: The onLoad event occurs when an interactive user initially displays an application, refreshes an application, or clears an application. |
Form | onLoad |
The onLoad event occurs when the form specified as the Trigger Source is loaded in Print Note: The onLoad event occurs when an interactive user initially displays a form, refreshes a form, or clears a form. |
Application |
onTimer |
The onTimer event occurs every 1-300 seconds, depending on the number specified in the Timer (in seconds) field. Clear the Repeat Timer? check box to prevent the timer from restarting and re-running the business rule. Tip: Avoid adding multiple onTimer triggers with short timer periods, as this may prevent users from being able to manipulate fields on the application. |
Form |
onTimer |
The onTimer event occurs every 1-300 seconds, depending on the number specified in the Timer (in seconds) field. Clear the Repeat Timer? check box to prevent the timer from restarting and re-running the business rule. Tip: Avoid adding multiple onTimer triggers with short timer periods, as this may prevent users from being able to manipulate fields on the form. |
The following trigger source and trigger event are used only if a label template must support both on-demand printing and integrations.
Trigger Source | Trigger Event | Description |
---|---|---|
Do Not Run |
Label |
This type of trigger allows you to prevent a data source from being run by any trigger if the data map entry You should ensure that the trigger key exists when the data source is run by an integration, and does not exist when the data source is run by an interactive user. If the label template is not required to support both on-demand printing and integrations, then this type of trigger source is not necessary. Important! For an integration, if the data map entry specified for Trigger Key does not exist, then the data source is queried and the first row of data is automatically returned. This occurs regardless of whether Auto Select First Row and Auto Select Single Row Result are selected. |
Trigger Priority
Assigning values for Priority is necessary only if more than one data source or rule associated with a label template or a form includes a trigger with the same trigger source, trigger event, and trigger key (if any). In that situation, you can assign different values for Priority for these otherwise identical triggers, and the data source or rule with the lower value for Priority is run first. For data sources, whether the type of data source differs has no effect.
Priority values for data sources are not compared with Priority values for actions and rules. Regardless of their Priority values, all data sources are run before any rules are run.
For a form that is used in an application, Priority values of rules created at the application level are not compared with Priority values of rules created at the form level. All rules configured for the form at the application level are run before rules configured at the form level.
Note: When viewing Form properties within an application, only rules that were created within the application are displayed. Although not displayed, rules that were created in the form are run when the form is used by an application.
Priority values are only compared if trigger source, trigger event, and trigger key (if any) are the same.
Tip: Trigger priorities can be set only while configuring data sources or rules, and are not required to be unique.
Example
A label template includes a Database data source (DS_DB01) and an Alternate data source (DS_Alt01). Each data source includes a trigger with a Trigger Source of /Body and a Trigger Event of onLoad. Because you want the Database data source to be queried before the Alternate data source, you set the Priority for DS_DB01 to 10, and for DS_Alt01 to 20. Although each data source may also have other triggers, their priorities are not compared with these triggers.
Best Practices
When assigning values for Priority, it is recommended that you avoid using adjacent integers so that it is easier to add intermediate values if necessary. In the preceding example, if you later discover that you need to add a third data source and need to cause it to run after DS_DB01 but before DS_Alt01, you can do so without having to change the existing trigger priorities. Also, for a particular form or label template, it is recommended that you use unique integers for Priority values that can be compared.
Trigger Type
Property | Description |
---|---|
Form Rule |
A list of form rules for which the loading of this object acts as a trigger to run each action Select the form rule to be run when the form is loaded, and then click OK. Important! If the object acts as a trigger for more than one rule and the order in which the rules are run relative to each other is important, then you must configure priorities for these triggers. For more information, see Configure a Form to Run a Data Source. Note: When viewing Form properties within an application, only form rules that were created within the application are displayed. Although not displayed, form rules that were created in the form are run when the form is used by an application. All rules configured for a form at the application level are run before rules configured for that form at the form level. |
Business Rule |
A list of business rules for which the loading of this object acts as a trigger to run each business rule Select the Trigger Event, the business rule to be run, and enter an event name that is specified by the business rule, and then click OK. Tip: You can use the Relative Path check box to control whether the path is represented as an absolute path or a relative path. Using a relative path may be helpful if an object is likely to be transferred to a different Loftware Enterprise SP instance Important! If the object acts as a trigger for more than one rule and the order in which the rules are run relative to each other is important, then you must configure priorities for these triggers. For more information, see Configure a Form to Run a Data Source. Note: When viewing Form properties within an application, only business rules that were created within the application are displayed. Although not displayed, business rules that were created in the form are run when the form is used by an application. All rules configured for a form at the application level are run before rules configured for that form at the form level. |
Data Sources |
A list of label data sources for which the loading of this object acts as a trigger to run the data source. This list can include Alternate data sources and Database data sources. Select the data source to be run when the object is loaded, and then click OK. Important! If the object acts as a trigger for more than one data source and the order in which the data sources are run relative to each other is important, then you must configure priorities for these triggers. For more information, see Configure a Form to Run a Data Source. Tip: For information about creating data sources or configuring triggers by editing a data source, see Configuring Label Data Sources and Controls, Actions, and Triggers. Note: The Data Sources property is not displayed when viewing Form properties within an application. |