2021.2

Table Of Contents
Example
The following script adds a paragraph to the results (elements that match the selector of the
script).
var div = query( '<div>' );
for ( let i = 0; i < 5; i++ ){
var p = query( '<p>' );
p.text( 'This is number ' + i );
div.append( p );
}
results.after( div );
Tip
The Dynamic Attachment script uses this function to add an attachment to an Email
section; see "Email attachments" on page538.
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
Page 1321