2020.2

Table Of Contents
When a script calls this function in Preview mode, the script that triggers it is marked with an
error icon in the Scripts pane, and the given message is displayed in a hint.
When generating output from the Designer, the Designer will log the error and display an error
dialog with the given message. Content creation is aborted.
When generating output from Workflow, the job fails. Workflow will log the error and execute
any follow-up actions that are defined in the On Error tab of the respective OL Connect Content
Creation task (All in One, Create Email Content, Create Print Content, Create Preview PDF,
and Create Web Content ). For more information about how to set up follow-up actions, see
Using the On Error tab in the Workflow Help.
Note
Errors thrown in a try statement do not abort content creation or trigger any follow-up
actions in Workflow. Content creation will continue with the next script, the same record.
for(... in ...)
Can be used to iterate over fields in a data set or rows in detail table. Also see
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in.
for(variable in object) {... }
Iterates over the enumerable properties of an object, in arbitrary order. For each distinct
property, statements can be executed.
Examples
This script iterates over field names in the current record and adds them to a paragraph.
for(var i in record.fields){
results.after("<p>" + i + "</p>");
}
Selector Matched element Matched element after script execution
#test <h1 id="test">Fields</h1> <h1 id="test">Fields</h1>
<p>first</p>
Page 1272