Hi All,
I have a form and there is a custom field called request type and this is a select list. Select list containes some values as [ test, project, defect]. if i save form as selecting defect from list this custom field supposed to be readOnly and shouldnt be updated.
I tried some code and managed to make field readonly, But in edit mode when i change request type form test to defect without saving the form this filed become immediately readonly. I need to make it work after saving the form.
if (getAction()?.id == 1)// Do not make field readonly on Create mode
{
return
}
def CustomField_ = getFieldByName("Request Type")
def selectedOption = CustomField_.getValue() as String
def isOtherSelected = (selectedOption == "Defect" )
CustomField_.setReadOnly(isOtherSelected);