2022.2

Table Of Contents
query(html)
CreatesanewHTMLelementontheflyfromtheprovidedstringofrawHTML,andreturnsthenewele-
ment.
html
AStringcontainingaHTMLelement.Tagsthatcancontainotherelementsshouldbepairedwithaclos-
ingtag.
Example
Thefollowingscriptaddsaparagraphtotheresults(elementsthatmatchtheselectorofthescript).
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: TheDynamicAttachmentscriptusesthisfunctiontoaddanattachmenttoanEmailsection;
see"Emailattachments"onpage167.
record
Therecordobjectgivesaccesstotherecordthatiscurrentlybeingmergedwiththetemplate.
Properties
Field Type Description
<fieldName>
Object Shortcuttoaccessafieldinthefieldsarray.Forexample,youcanuse
record.FirstNametoaccessrecord.fields.FirstName.
Ifarecordhasafieldandatableofthesame name,record.<fieldName>will
returnthetable.
fields
Array Thefieldvaluesthatbelongtothisrecord.
id
Number Theidofthisrecord.
index
Number Theone-basedindexofthisrecord,orzeroifnodataisavailable.
<tableName>
Arrayof
records
Shortcuttoaccessatableinthetablesarray.Forexample,youcanuse
record.Productstoaccessrecord.tables.Products.
Page 743