2019.2

Table Of Contents
Object Usage
page806 record, use record.fields['fieldname'] or record.fields.fieldname.
"section" on
page907
Much of the Control Script magic is performed by setting one of the fields of
the section object. Via the section object you can omit, select and
clone sections; add a background to a Print section; add a header to an
email; etc.
A section can be retrieved via the context that it belongs to, using
merge.template.contexts.ContextType.sections
["section name"]. For example:
merge.template.contexts.PRINT.sections["Section EN"].
"template" on
page891
The template object contains all contexts and sections. It is accessed
through the merge object: merge.template.
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907) inside a
particular context defined in the template.
Note: When using merge.context.sections keep in mind that
for example 'Section X' might only exist in your Print context,
so using merge.context.sections['Section X'] without
enclosing it in the if statement if (merge.context.type ==
ContextType.PRINT) {} will yield an error when the script
runs for other contexts.
Alternatively, use the template object to access a specific
context: merge.template.contexts.PRINT.sections
['Section X'].
Page 867