One of the main strengths of NiceForm and NiceLabel Portal are actions that let you build workflows that accomplish manual chores quickly, efficiently and effortlessly. You don’t have to know any scripting languages or write any code (unless you want to). Instead, you create and execute workflows simply by dragging and dropping actions. Currently there are 29 actions available in NiceForm. They are grouped in 6 groups: Labeling, Variables, Batch Printing, Database, Connectivity and Other.
Labeling actions: “Open label”, “Print label”, “Set printer”, “Send custom commands”, “Run command file”, “Close label”, “Define printer settings”.
Variables actions: “Set variable”, “Save variable data”, “Load variable data”.
Batch printing actions: “For every label”, “For every record in a table”, “For loop”.
Database actions: “Refresh database”, “Execute SQL statement”, “Import data into database”.
Connectivity actions: “Read data from serial port”, “Write data to serial port”, “Send data to TCP/IP port”, “Acquire image”.
Other actions: “Open another form”, “Open document/program”, “Refresh previews”, “Quit”, “Execute script”, “Move focus to object”, “View log file”, “Browse for file or folder”, “Verify license”.
Where can actions be used in the form?
Actions are executed on certain events that happen on the form. Form itself has three events – On Form Load, On Form Close and On Timer – that can be used to execute actions when form is loaded, closed or when a specified time interval elapses. Also almost all objects (with the exception of the Frame object) have one or more events that trigger action execution (check the “Events” page of the object properties dialogs). Usually these are: On Click (when object like Button is clicked), On Focus (when object becomes active), On Exit (when input focus shifts away from the object) or On Change. Even variable can execute actions when its value changes.
You define actions and their properties in the “Actions Editor” dialog box. This dialog is the same in both NiceForm and NiceWatch so everything that works in NiceForm should also work in NiceWatch (there are some differences in the action types supported).
“Actions Editor” has three sections. On the left you can see a list of all available actions grouped together by functionality (or action type) in several groups. To define action workflows you just have to drag and drop the action to the area on the right or select one and click “Insert” button at the top of the window.
There is a small toolbar at the top of the right section. “Properties” button opens the properties of the currently selected action in the right pane(you get the same effect by double clicking the action). By clicking the “Delete” you will delete the selected action. Click on the arrow buttons to change the order and hierarchy of the actions in the right pane. Some of the actions like “Open label”, “For every label”, “For every record in a table” and “For loop” work on their “sub” actions – actions that are essentially their child actions. See the picture below for some samples.
The two remaining buttons in the top toolbar are the “Copy” and “Paste” buttons. You can copy/paste actions between different parts of NiceForm, between different instances of NiceForm and even between NiceForm and NiceWatch (if action is available in both applications).
At the bottom of the dialog you can find buttons to close the window, open help file and switch between Basic and Advanced views of the window. You can see the “Actions Editor” in the (default) Basic mode below. The difference between them is that the Basic view shows only the basic, most used actions, while the Advance view shows all available actions.
Protecting your know-how
If you do not want the end-user to modify forms you have created or to see how you implemented a very complicated script, you can lock (protect) the form with a password. In this case all the actions will be encrypted. Of course you have to make sure you do not forget the password because in that case you will have to design the forms from the start.
To lock the form, do the following:
- Open your form.
- Select the “Form Properties” option in the “File” menu or double click the form to open “Form Properties” dialog box.
- Go to the Advanced tab.
- Tick the “Form locked” option.
- Tick the “Password protection” and click on the “Set password” button.
- Provide the password and click on the “OK” button to close the “Set Password” dialog.
- Click on the “OK” button to close the “Form Properties” dialog box.
- Select the command Save in the File menu.
- Close the form.
Actions that are not supported in NiceLabel Portal
Some of the actions are currently not yet supported in NiceLabel Portal. These are: “Close label”, “For every label”, “Move focus”, “Refresh previews”, “Read data from serial port”, “Write data to serial port”, “Acquire image”, “Browse for file or folder”, “Define printer settings” and “Verify license”. “Import data into database” action is available only in NiceLabel Portal. We plan to support all actions that make sense in the browser environment in the future releases.