To make accessing object properties and values easier, FormCalc includes shortcuts to reduce the effort required to create references. The following table outlines the reference syntax shortcuts for FormCalc.
$
$ = “Tony Blue”
Represents the root of the data model xfa.datasets.data. For example,
$data.purchaseOrder.total
xfa.datasets.data.purchaseOrder.total
$event.name
xfa.event.name
$form.purchaseOrder.tax
xfa.form.purchaseOrder.tax
$host.messageBox(“Hello world”)
xfa.host.messageBox(“Hello world”)
$layout.ready
xfa.layout.ready
$record.header.txtOrderedByCity
references the txtOrderedByCity node within the header node of the current XML data.
$template.purchaseOrder.item
xfa.template.purchaseOrder.item
!
Represents the root of the data model xfa.datasets. For example,
!data
xfa.datasets.data
*
xfa.form.form1.item[*]
..
You can use two dots at any point in your reference syntax to search for objects that are a part of any subcontainer of the current container object, such as a subform. For example, the expression Subform_Page..Subform2 means locate the node Subform_Page (as usual) and find a descendant of Subform_Page called Subform2.
Livecycle tree hierarchy FormCalc reference syntax shortcuts
Subform_Page..TextField2
Subform_Page.Subform1[0].Subform3.TextField2[0]
because TextField2[0] is in the first Subform1 node that FormCalc encounters on its search. As a second example,
Subform_Page..Subform3[*]
returns all four TextField2 objects.
#
The number sign (#) notation is used to denote one of the following items in a reference syntax:
xfa.form.form1.#subform
Specify a property in a reference syntax if a property and an object have the same name. For example, the following reference syntax accesses the name property of a subform if the subform also contains a field named name:
xfa.form.form1.#subform.#name
[ ]
The square bracket ([ ]) notation denotes the occurrence value of an object. To construct an occurrence value reference, place square brackets ([ ]) after an object name, and enclose within the brackets one of the following values:
[ n ], where n is an absolute occurrence index number beginning at 0. An occurrence number that is out of range does not return a value. For example,
xfa.form.form1.#subform.Quantity[3]
refers to the fourth occurrence of the Quantity object.
[ +/- n ], where n indicates an occurrence relative to the occurrence of the object making the reference. Positive values yield higher occurrence numbers, and negative values yield lower occurrence numbers. For example,

   xfa.form.form1.#subform.Quantity[+2]

This reference yields the occurrence of Quantity whose occurrence number is two more than the occurrence number of the container making the reference. For example, if this reference was attached to the Quantity[2]object , the reference would be the same as

   xfa.template.Quantity[4]

If the computed index number is out of range, the reference returns an error.

The most common use of this syntax is for locating the previous or next occurrence of a particular object. For example, every occurrence of the Quantity object (except the first) might use Quantity[-1] to get the value of the previous Quantity object.

[*] indicates multiple occurrences of an object. The first named object is found, and objects of the same name that are siblings to the first are returned. Note that using this notation returns a collection of objects. For example,

   xfa.form.form1.#subform.Quantity[*]

This expression refers to all objects with a name of Quantity that are siblings to the first occurrence of Quantity found by the reference.

Note:
In language-specific forms for Arabic, Hebrew, Thai, and Vietnamese, the reference syntax is always on the right (even for right-to-left languages).
[ ]
Livecycle tree hierarchy FormCalc reference syntax shortcuts
Subform_Page.Subform1[*] returns both Subform1 objects.
Subform_Page.Subform1.Subform3.TextField2[*] returns two TextField2 objects. Subform_Page.Subform1 resolves to the first Subform1 object on the left, and TextField2[*] evaluates relative to the Subform3 object.
Subform_Page.Subform1[*].TextField1 returns both of the TextField1 instances. Subform_Page.Subform1[*] resolves to both Subform1 objects, and TextField1 evaluates relative to the Subform1 objects.
Subform_Page.Subform1[*].Subform3.TextField2[1] returns the second and fourth TextField2 objects from the left. Subform_Page.Subform1[*] resolves to both Subform1 objects, and TextField2[1] evaluates relative to the Subform3 objects.
Subform_Page.Subform1[*].Subform3[*] returns both instances of the Subform3 object.
Subform_Page.* returns both Subform1 objects and the Subform2 object.
Subform_Page.Subform2.* returns the two instances of the NumericField2 object.

FormCalc reference syntax shortcuts