You can reduce the form’s load and run time by minimizing the frequency in which you use the set function.
The set function is commonly placed within a custom option, and used to set the value of another option in the form. However, if this method is used frequently, it can reduce the performance of the form. Instead of using a set
function, consider placing a compute directly into the option you are trying to set, and make this compute copy the value to that option. Using a direct reference to copy values is much quicker than using toggle
The following example shows a field that contains a custom option that uses a toggle and set compute to copy a value from the "nameField" on page 1 to the "nameLabel" on page 2. This is NOT the recommended method for copying data.
<custom:setName xfdl:compute="toggle(value) == '1'
? set('PAGE2.nameLabel.value', value) : ''"/>
A simpler method is to add a reference to the "nameField" from the "nameLabel". This allows the field to share its value with the label, updating the label anytime the field is modified:
Exceptions to this practice
There are no exceptions to this practice.