2022.2

Table Of Contents
merge
InControlScripts,therootlevelinstanceoftheobjectmergeistheentrypointfromwhereyoucan
queryandchangethewaycontextsaremerged.Itgivesaccesstothetemplatewithallitscontextsand
sections.
FormoreinformationaboutControlScripts,see"ControlScripts"onpage838and"ControlScriptAPI"
onpage1271.
SomeoftheobjectsarealsousefulinPostPaginationScripts;see"PostPaginationScripts"on
page850and"PostPaginationScriptAPI"onpage1297.
Forsamplescripts,followthelinkstotherespectiveobjects.
Field Type Description
channel
"Channel"on
page1294
Thefinaloutputchannel:EMAIL,PRINTorWEB.Thechanneldoesn'tchangewhentheoutputconsistsofdif-
ferentcontexts.Whengeneratinganemail,forexample,thechannelisEMAIL,evenwhenmergingthePrint
contexttoattachittotheemail.
"context"on
page1299
Context Thecontextrenderedbythismergerun.Ifforonerecord,differentcontextsneedtobeoutput(forexample,
whenthePrintcontextisattachedtoanemail)arecordismergedmultipletimes:oncepercontext.Per
mergerun,merge.contextshowswithwhichcontexttherecordismerged.
pagination
"Pagination"on
page1314
ContainsthetotalpagecountandsheetcountofallsectionsinthePrintcontextafterpagination.
"section"on
page1305
Section InStandardScripts,thisobjectdefinesthesectionthatisbeingmerged.
Note!InControlScripts,merge.sectionisonlyavailablewhentheoutputchannelisWEB.Tomake
surethatitisdefined,usethefollowingstatement:if (merge.channel == Channel.WEB &&
merge.context.type == ContextType.WEB) { ... }.
ToretrieveanysectioninaControlScript,use:merge.tem-
plate.contexts.ContextType.Section['Section name'];(forexample:merge.tem-
plate.contexts.PRINT.sections["Section EN"]).
InPostPaginationScripts,onlyPrintsectionsareavailable.
"template"on
page1292
Template Thisobjectcontainsthetemplateandallofitscontexts.Itcanbeusedtofindoutwhichcontextsareavailable
inthetemplate,usingmerge.template.contexts(see"context"onpage1299)andtomanipulatethe
sectionsinthosecontexts(see"section"onpage1305).
template
Thetemplateobjectrepresentsthetemplatewithallitscontextsandsections.Itisusedfrequentlyin
ControlScripts(see"ControlScripts"onpage838and"ControlScriptAPI"onpage1271)butitcan
alsobeusedinStandardScripts.
Itisretrievedviathemergeobject:merge.template(see"merge"onpage1313).
Page 1189