2021.1

Table Of Contents
Tip
The Dynamic Attachment script uses this function to add an attachment to an Email
section; see "Email attachments" on page530.
record
The record object gives access to the record that is currently being merged with the template.
Properties
Field Type Description
fields Array The field values that belong to this record. You can
access a specific field value using either a numeric
index or the field name: record.fields['fieldname'] or
record.fields.fieldname.
id Number The id of this record.
index Number The one-based index of this record, or zero if no data is
available.
tables Array The detail tables that belong to this record.
You can access a specific table using either a numeric
index or the table name, followed by a numeric index for
a record inside that detail table.
For example, to access the value of the field "prod_id" in
the first record of a detail table called "detail", you can
use: record.tables["detail"][0].fields.prod_id or
record.tables.detail[0].fields.prod_id.
In order to loop over the records in this table you could
use the table's length property (e.g.
record.tables.detail.length), or use for(... in ...) (see
"for(... in ...)" on page1278) or an 'Each matched
element' script (see "Setting the scope of a script" on
page874).
Page 1302