2020.1

Table Of Contents
used in Control Scripts, however. This is because Control Scripts differ from template scripts
(see "What Control Scripts are" on page879). For example, the query() function can't be used
in a Control Script because it requires access to the DOM which a Control Script doesn't have.
Object Usage
channel (see
"Channel" on
page1387)
The channel for which output is generated. This is registered in the merge
object: merge.channel.Note that the channel doesn't change when the
output consists of different contexts. When generating email, for example,
the channel is EMAIL, even when merging the Print context to attach it to
the email.
"context" on
page1392
Object that contains one context and its sections. It is accessed through the
template object: merge.template.contexts. To get access to one
context, you have to specify the ContextType (see "ContextType" on
page1388), for example: var printContext =
merge.template.contexts.PRINT;.
Through the merge object you can find out which context is currently being
merged: merge.context.
"masterpage"
on
page1360
The masterpage object is used to set a Master Page's header and footer
or to replace its entire HTML body.
"merge" on
page1410
The merge object gives access to the template with all of its contexts and
sections .
"record" on
page1278
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.
"section" on
page1400
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:
Page 1356