Hello All,
I have an issue wherein my validationMessage is not removing after clicking cancel button. My scenario is I have a User Form that whenever I click submit it will show a message "All fields are required". After that I will now click the Cancel Button. However, when I go back to the Form my validation is still there. Can anyone explain to me how can I prevent that from happening?Here's my validation
a!validationMessage( message: "You must fill up both roles and email address!", validateAfter: "SUBMIT", showWhen: or(isnull(local!email), isnull(local!role)) )
Here's my field
a!textField( label: "Email", labelPosition: "ABOVE", value: local!email, saveInto: local!email, refreshAfter: "UNFOCUS", validations: {} )
I put the validationMessage under the columnLayout.
Discussion posts and replies are publicly visible
Hello, sorry I'm not using any process model for navigating interfaces.
So you're saying I need to create a process model to do that?
If you are not submitting the form on cancel button, then you can try this
a!localVariables( local!amount, local!buttonValue, local!showWhen:and(local!buttonValue,isnull(local!amount)), a!formLayout( contents: { a!textField( label: "Amount", value: local!amount, saveInto: local!amount ) }, buttons: { a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Submit", style: "PRIMARY", submit: true, saveInto: { a!save(local!buttonValue,true) } ), a!buttonWidget( label: "cancel", saveInto: { a!save(local!buttonValue,false) } ) } ) }, validations: a!validationMessage( message: "Is required", validateAfter: "SUBMIT", showWhen: local!showWhen ) ) )
Hello, Thank you for your response. However, I already tried it changing the showWhen value to false when I click cancel. However, when I go back to userRegistration form the validation will be removed. But when I add ri!ShowWhen then change it back to true after clicking the "Create User" button the validation is still there.
You are using same showWhen parameter for "Create User" button and "Submit" button?
I have two interface I have ri!action on both interface. I'll show the userManagement if the value of ri!action is "userManagement" and "add" for userRegistration. so when I clicked cancel i change the ri!action value to "userManagement" to go back to the previous interface.
Yes.
Have a look at https://docs.appian.com/suite/help/21.2/record-actions.html
Basically it is: "Use a process for user actions."
I know there is always a way to not need a process model and I do that myself if, and only if, there is a benefit. But this is a topic for later in your learning path.
A note here: This is not "go back". You have a global scope defined by that main interface and validation happens in this scope. Showing or hiding any parts does not change that global scope nor validation. Once triggered it stays triggered as long as you submit the form.
This issue has been resolved using this method. Thank you!
A process model is required for most processing beyond simple database writes. And it's often a good idea to use one anyway (unless you have specific reasons to avoid doing so) since it makes for easier debugging and troubleshooting.
Yeah, I thought it only revolves in the interface section since its mostly a design and validation handling, never knew process model is also connected to this. Again, thank you for the insight.