Create a Script Data Source
By using a Script data source, you can specify the data value or alter the visual properties of a field based on the result of a JavaScript. For information about scripting syntax and capabilities specific to Loftware Enterprise SP, see Scripting.
Loftware Enterprise™ SP uses the Rhino JavaScript engine for Script data sources and supports both the Rhino and Nashorn JavaScript engines for use in scripts in business rules. Rhino is an open source JavaScript engine maintained by the Mozilla Foundation, and Nashorn is an open source JavaScript engine maintained by Oracle. These engines enable you to parse, compile, and run JavaScript statements.
Note: JavaScript versions 1.3 and later conform to the Standard ECMA-262 ECMAScript Language Specification. For more about this specification, see "Scripting, Java, and XML" in External Links.
To create a Script data source, a Designer Person who creates and designs label templates, forms, and applications for use by Data Providers. can use the following procedure.
- In Label Design
- In the View tab, click Data Sources.
- Click Script, and click
. The Script Data Source dialog box is displayed.
- Enter a name for the label data source in the Data Source Name field.
Note: The name of a label data source can include letters and numbers. Additionally, the following characters are permitted but cannot begin or end the name: double quotation marks, single quotation marks, grave accents, hyphens, underscores, and periods.
- Enter or paste your script in the Script field.
Enter Fields, Data References, and Database Columns
Use the Fields, Data Ref List, and Database Columns to enter fields and data references in a script. Using these fields enters each reference with the proper syntax.
Verify the Script
To check the syntax of your script, click Verify Script.
If the syntax is correct, the Verify Results field displays Script verification completed successfully.
If there are errors in the syntax, the Verify Results field displays the first error encountered. For example, "Line 2: ReferenceError: x is not defined."
Clear the Script
To remove the current script from the Script field so that you can enter a different script, click Clear Script.