Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Mandatory

  • Last UpdatedJun 25, 2024
  • 1 minute read

Use scripts for the Mandatory property to enforce or bypass entering a value for a control.

To enforce or bypass entering a value for a control

  • Code the script as follows for the Mandatory property of a control:

Task

Script

  • Enforce entering a value for the control.

return true;

  • Bypass entering a value for the control.

return false;

To enforce or bypass entering a value for a control based on the value of another control

You can enforce or bypass entering a value for a control based on the value of another control.

Example

If you want to enforce entering a value for the Last Name (T2) control when a name is entered in the First Name (T1) control, then you can code the script for the Mandatory property of the Last Name (T2) control as follows:

if(control.findById("T1").value !== "")

{

return true;

}

else

{

return false;

}

Note:
- The currentValue method returns the value for the current property of a control.
- For the Mandatory property, the value is true when the control is enforced and the value is false when the control is bypassed.

TitleResults for “How to create a CRG?”Also Available in