2020.1

Table Of Contents
Designer API
Features like results and record do not exist in the native JavaScript library. These are
additional JavaScript features, designed for use in Connect scripts only. All features designed
for use in the Designer are listed in the Designer's API, with a lot of examples; see "Standard
Script API" on page769.
Setting the scope of a script
The selector of a script can match multiple elements. By setting the scope of the script you can
determine whether you want to run the script once, or once for each element that matches the
selector. The second option is especially useful when a script targets rows or cells in a
Dynamic Table (see "Using scripts in Dynamic Tables" on page409).
To set the scope of a script, click on Options at the bottom of the Script Editor window. The
options are:
l
Result set: The script will run once, regardless of the number of elements that match the
selector. It will have access to all elements that match the selector via the results
object (see "results" on page909). The each() function could be used to iterate over
elements in the results.
l
Each matched element: The script runs once for each element that matches the selector.
The current element is accessible via the this object (see "this" on page834). If the
script targets (something in) a row that is bound to a detail table, the current detail record
is accessible via this.record.
Note
The scope of Control Scripts can't be set, because they don't have a selector.
Managing scripts
Changing the order of execution
When a record set is merged with a template to generate output, all scripts are executed once
for every record in the record set, in the order in which they appear in the Scripts pane at the
bottom left.
Page 383