Requirement:
To avoid having to set every field available on the edit screen individually to read only, it would be a lot easier to just use an initializer that sets every field to editable false depending on project role.
The reason I want to use Behaviors for this instead of setting editable false on the status on the workflow, is because my workflow schemes are shared and I don't want the restriction to apply to other projects and I also don't want to have to copy the project over to a clone of the same workflow just to satisfy this requirement.
Basically something like the below:
You can get to each fields using the getFieldScreen method that's built into behaviours.
something like
getFieldScreen().tabs.each { tab ->
tab.fieldScreenLayoutItems.each { field ->
getFieldById(field).setReadOnly(true)
}
}
Or as a one-liner
fieldScreen.tabs*.fieldScreenLayoutItems*.each{getFieldById(it.fieldId).readOnly = true}
@PD Sheehan Thank You,
I just used this to hide all fields, then show only specified fields dependant on the Customer Request Type, from another one of your posts :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.