Writing Global MetaScript For A Form

Writing Global MetaScript For A Form

As mentioned previously, the Global MetaScript of a newly-created Job Manager form contains no MetaScript commands and function definitions. The Form Editor allows you to view the global script of forms and to add the appropriate MetaScript code.

To edit the Global MetaScript of a form:

1. Select Global MetaScript ( ) from the Form Properties Palette. A Global MetaScript Code window will appear, allowing you to define a global script for the form currently opened in the Form Editor.

Important! Global MetaScript code must specify the MetaScript version to be used in the form. The version line will be inserted into the Global MetaScript by default (with the latest MetaScript version) when a new form is created.
If the version line is absent, type
//@version <version_number>
(currently <version_number> should be "2.0") at the beginning of your code.

2. Type the appropriate MetaScript code in the script editor window. Functions defined in this code will be available to the form object scripts of the form. You may also define these functions in a text file, and then include them in the Global MetaScript by typing
//@include "file:<fileName.ext>"
if the file is located in the file system (it must be in the same folder as the Job Manager desktop client), or
//@include "database:<fileName.ext>"
if the file is stored in the database.

For details on functions and commands supported by MetaScript, please refer to the MetaScript Reference manual. For instructions on storing MetaScript files in the Job Manager database, please refer to the Storing Scripts section of this chapter.

TIP: While in the script editor window, you may use the Database Field button to quickly insert the name of any database field (except the file collector field) or variable placed on the form.

3. Close the script editor window by clicking the close window box in the upper left hand corner. This will bring up a dialog box confirming the change of the Global MetaScript.
4. Select Save Form from the Form menu to save the changes you have made to the form.


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.