I am making a small change in the Ticket form. Based on a particular status, I want to show Priority dropdown and make it mandatory. However, in all statuses before this, the Priority dropdown is hidden. The statuses are driven by workflow.
I could make the dropdown readOnly true or false. However, I am not getting any solution to make it visible true or false, and required true or false.
Please help.
I am an Eagle. On a mission to help those who want to help themselves...
Just use $_fieldsAttributes that you change in constructor
function __construct($id = NULL, $withoutDependentObjects=false) {
parent::__construct($id,$withoutDependentObjects);
if ($this->idStatus=1 or $this->idStatus=2) { // and so on
self::$_fieldsAttributes['idPriority']='hidden';
} else {
self::$_fieldsAttributes['idPriority']='required';
}
}