Hi Everyone,
I have a requirement like. Action dropdown with value
Use Case 1 – If user select Approve from action dropdown, Comment field should be optional.(non-required)
Use Case 2 – If user select Reject or Terminate from action dropdown, Comment field should be become mandatory (*Required field)
We have below code,
a!localVariables( local!selectedaction, local!comment, local!submitClick, local!isActionChanged, local!previousSelection, a!formLayout( label: "Form", contents: { a!sectionLayout( label: "Section", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField( label: "Action", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: { "Approve", "Reject", "Terminate" }, choiceValues: { 1, 2, 3 }, value: local!selectedaction, saveInto: { a!save(local!comment, null), a!save(local!submitClick, false), a!save(local!isActionChanged, true), a!save( local!previousSelection, local!selectedaction ), a!save(local!selectedaction, save!value) }, searchDisplay: "AUTO", required: true, requiredMessage: "Please select action", validations: {} ) } ), a!columnLayout( contents: { a!paragraphField( label: "Comment", labelPosition: "ABOVE", value: local!comment, saveInto: local!comment, refreshAfter: "UNFOCUS", height: "MEDIUM", required: if( and( a!isNotNullOrEmpty(local!selectedaction), local!selectedaction <> 1 ), true, false ), requiredMessage: "Comment is required." ) } ) } ) } ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", submit: true, validate: true, value: local!submitClick, saveInto: { a!save(local!submitClick, true) }, style: "PRIMARY", validationGroup: "Comment" ) } ) ))
The issue what we are facing here is
Required filed error message is not getting cleared post user click submit upon action dropdown change.
Steps:
Can someone help us here.
Discussion posts and replies are publicly visible