2020.2

Table Of Contents
Example
If the selector of a script is p.onlyCanada, and its scope is set to "Each matched element", the
script will be repeated for all paragraphs that have the onlyCanada class; it can access only one
paragraph at a time. The script could use this to manipulate each paragraph, e.g. hide or show
it depending on the value of a data field Country in the current record:
if (record.fields["Country"] == "CANADA") {
this.show();
} else {
this.hide();
}
Note
In a script that has its scope set to "Each matched element", the results object is still
accessible, and can be used in a non-iterative way (for example, you could use its
length property to determine the total number of matched elements) but iterating over
results will produce a warning.
Properties
Field Type Description
id Number Index in the result set, or zero if this element is not part of a
result set.
record
Record Represents the current detail record in a (possibly nested)
detail table associated with repeating rows in a Dynamic Table.
This property is only available when this is a row or child
element of a row in a Dynamic Table. (See "Dynamic Table" on
page801.)
If this (the current QueryResult instance) cannot be matched to
a detail record, this.record is null.
runningTotal Number Can be used to update a running total. It is initialized to zero
when a loop over results starts.
Page 1339