This document provides information on how to use business logic to hide a property (field), or to make it visible, after the value of a different property has been updated.
In the process described below, we are adding a script to a representation class to hide property MYPROP2 when the value of property MYPROP1 is set.
$PROPERTIES and $METHODS labels are called in the event. You can also manually enter the running order code for your script.$PROPERTIES
Case CURPRO
When "MYCLASS.MYPROP1" : Gosub MYPROP1
Endcase
Return
# Actions for "MYPROP1"
$MYPROP1
Case ACTION
When "PROPAGATE" : Gosub PROP1_PROPAGATE
Endcase
Return
# Set MYPROP2 to hidden or visible, depending on value of MYPROP1
$PROP1_PROPAGATE
If THIS.MYPROP1 = CST_AYES
ASTATUS = fmet THIS.ASETATTRIBUTE("MYPROP2","$isHidden","true")
Else
ASTATUS = fmet THIS.ASETATTRIBUTE("MYPROP2","$isHidden","false")
Endif
Return