Referencing scripts
Sometimes it is useful to assign one script to more than one event. Copying one script to events of multiple fields is possible, but it brings about a lot of discomfort when the script needs to be updated at all these places. It is better to assign the script to just one field and reference it in all the other.
To reference a script, replace the regular script text by a line of one of the following formats depending on what type of a script you are about to reference.
To reference OnChange and OnValidate events, use the following format:
{$REF_ATTRIBUTE LayerName.AttributeName}
e.g. {$REF_ATTRIBUTE Plots.Description}
To reference OnLayer events, use the following format:
{$REF_LAYER LayerName.EventName}
e.g. {$REF_LAYER Trees.AfterDelete}
To reference Global events, use the following format:
{$REF_OTHER GroupName.EventName}
e.g. {$REF_OTHER FieldMap.AfterOpenFieldMap}
Note that the "//" comment identifier must be included and the "begin" and "end." identifiers must not.
In many situations PerformLayerScript. PerformOnChangeScript and PerformOnChangeScriptForAllRecords functions can be used to simplify above described process.
See also:
Accessing Field-Map data within a script; Using Field-Map predefined variables; Using Field-Map global variables; Disabling events; Referencing scripts
© 2024 IFER-Monitoring and Mapping Solutions