AncestorByProperty Method
The AncestorByProperty method finds the closest ancestor of a field that has the specified property or tagged value.
This is particularly useful when a field is mapped to an attribute of a user class object and you need a reference to that object, or when an unnamed display panel contains a number of fields, variously nested, and you need a reference to the panel field if one of the fields is triggered.
This method has the following syntax:
FormField = RequestManager.AncestorByProperty(descendant = FormField,
attributename = varchar(32) | tagname = varchar(32), searchstring = varchar(256))
This method has the following parameters:
descendant
(Required) The form field whose ancestor is sought.
attributename
(Either this or tagname is required) Specifies the name of the ancestor-field property that must match the searchstring.
tagname
(Either this or attributename is required) Specifies the name of the ancestor-field tagged value that must match the searchstring.
searchstring
(Required) Specifies the value that the property or tagged value must match.
This can be wildcarded. For more information about wildcards, see the CompositeField class
FieldsByProperty Method).
The method returns the ancestor field, or null if no ancestor met the criterion.
Last modified date: 06/25/2024