Application DesignControls, 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 triggerClosed 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 sourceClosed 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 actionClosed 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 ruleClosed 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 Label Design, you can configure triggers for Database data sources and Alternate data sources. You can use either of the following approaches to select a trigger for a data 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 , while you are configuring a business rule you can configure triggers that can be used to run specific component sets. For more information, see Triggers in the Configurator.
  • If you program business rules by using XML in Application Design , while you are configuring a business rule you can configure triggers that can be used to run specific business rule components. For more information, see Triggers and Events.

In addition to being associated with a data source, action, or rule, each trigger in Label Design Label Design also has trigger sourceClosed 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 eventClosed 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., priorityClosed 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 typeClosed Whether the trigger is for an action, rule, or data service. or a trigger keyClosed 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 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 Print.

Drop-Down List field

onChange

The onChange event occurs when an interactive user in Print Print changes which option is selected in the Drop-Down List field that is specified as the Trigger Source.

Device Selector field

onChange

The onChange event occurs when an interactive user in Print Print selects a device by using the Device Selector field specified as the Trigger Source.

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 Print changes which option is selected in the Radio Button Group field that is specified as the Trigger Source.

Prompt field

onFocusOut

The onFocusOut event occurs when an interactive user in Print Print enters text then clicks to another field, tabs to another field, or presses the Enter key to submit the text in the Prompt field to Loftware Enterprise SP.

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 Print enters text then clicks to another field, tabs to another field, or presses the Enter key to submit the text in the Text Box Prompt field to Loftware Enterprise SP.

Table field

onDoubleClick

The onDoubleClick event occurs when an interactive user in Print Print double-clicks the Table field specified as the Trigger Source.

Application onLoad

The onLoad event occurs when the application specified as the Trigger Source is loaded in Print Print for an interactive user.

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 Print for an interactive user.

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 entryClosed A name (key) and value pair in the data map for a job. with the name specified as the Trigger Key exists. If the trigger key does not exist, then other triggers can be used to run the data source. The value of the data map entry does not affect this behavior.

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 actionClosed 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. .

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 ruleClosed 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..

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 instanceClosed A Loftware Application Server and a Loftware Database Server that are associated with each other by a Loftware Enterprise - SP License.. The check box is available to select after the object has been saved for the first time. For more information, see Relative Paths.

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.