1.6

Table Of Contents
Object Usage
page809)
"record" on
page787
The current record in the main data set. To get the value of a field in the
record, use record.fields['fieldname'] or record.fields.fieldname.
Other objects that are available to Control Scripts
The list above isn't exhaustive: most of the objects listed in the Designer API (see "Designer
Scripts API" on page742) are also available in Control Scripts. Not all of those objects can be
used in Control Scripts, however. This is because Control Scripts differ from template scripts in
two ways:
l Control Scripts don't have a selector, like template scripts do.
A selector selects parts of the content of a section and stores them in the results
object, so that they can be modified in the script. As Control Scripts don't have a selector,
the results object can't be used there. Control Scripts don't touch the content -
meaning, the text flow - of the sections.
l Control Scripts run before all other scripts.
When a template consists of several contexts, and these contexts are combined in the
output - for example, when an Email is generated with the Print context as attachment - all
scripts run once for each context, but Control Scripts always go first.
context
In a Control Script, the context object represents one context in the template.
Which contexts are available in the template can be queried using merge.template.contexts.
The context being merged can be queried using merge.context.
Field Type Description
sections Array
Array of sections (see "section" on page800) inside a
particular context defined in the template.
Page 799