This document provides information on how to use business logic to make a property (field) mandatory or optional when the value in a different property is updated.
The process described below demonstrates how to add a script to a data class to set the value of one property (MYPROP2) to mandatory or optional when the value of a different property (MYPROP1) is set.
$PROPERTIES and $METHODS labels are called in the event. You can also enter the running order code for your script.$PROPERTIES
Case CURPRO
When "MYPROP1" : Gosub MYPROP1
Endcase
Return
# Actions for "MYPROP1"
$MYPROP1
Case ACTION
When "PROPAGATE" : Gosub MYPROP1_PROPAGATE
Endcase
Return
# Set MYPROP2 to Mandatory or not, depending on value of MYPROP1
$MYPROP1_PROPAGATE
If THIS.MYPROP1 = CST_AYES
ASTATUS = fmet THIS.ASETATTRIBUTE("MYPROP2","$isMandatory","true")
Else
ASTATUS = fmet THIS.ASETATTRIBUTE("MYPROP2","$isMandatory","false")
Endif
Return