Hi team, I been pondering and I would like to disable only the "direct approve" option upon conditions met. Is that possible?
a!localVariables( local!choiceLabels: { approve, reject, direct approve, direct reject }, a!radioButtonField( label: "This application is recommended for", labelPosition: "ABOVE", choiceLabels: local!choiceLabels, choiceValues: local!choiceValues, value: ri!recommendedFor, saveInto: {}, disabled: since it allowed only true()/false()? )
Discussion posts and replies are publicly visible
Not really. Either you disable all the options or keep all of them enabled. A workaround is to create multiple radioButtonFields for each option and then control their disabled state individually.
Additionally, what I generally do here is to manage the selection options in a local refresh variable and continue to use a single radio button or dropdown, such as:
a!localVariables( local!canApproveDirect: true, local!options: {"Approve","Reject","Direct Approve","Direct Reject"}, local!choices: a!refreshVariable( value: if( local!canApproveDirect, local!options, index(local!options,{1,2}) ) ), local!selection, { a!radioButtonField( label: "Direct Approvals", choiceLabels: {"Yes","No"}, choiceValues: {true,false}, value: local!canApproveDirect, saveInto: { local!canApproveDirect, a!save(local!selection,null) } ), a!radioButtonField( label: "This application is recommended for", labelPosition: "ABOVE", choiceLabels: local!choices, choiceValues: local!choices, value: local!selection, saveInto: local!selection ) } )
For other users: Another good alternative is to also hide so dont have to hardcode the same saveInto values multiple times. Thanks for your answer!