Support Article
Conditional calling Local action on click of Submit button
SA-107351
Summary
On invoking a Local action conditionally on click of the Submit button, the user must click the button twice to validate the When condition.
Error Messages
Not Applicable
Steps to Reproduce
- Create a section with dropdowns and an AutoCorrect conrtol.
- Create a button with an Action set to open a modal dialog based on a When rule. The When rule is based on the dropdowns and AutoCorrect values.
- Click the button twice to use the When rule such that the popup displays. However, the When rule is true both times.
Root Cause
The Action markup for the control is generated based on the When Rule's evaluation on a Section Refresh or First load. The When Rule is updated after the Action markup is generated.
Resolution
- Add a Refresh action on the Autocomplete property error code using the When condition as a ‘rule’ in the Local action of the Submit button.
- Use the When as ‘other property’ instead of When rule and add all the conditions. If Step 2 is not feasible, create a boolean property (for example, Test) and create a Declare Expression on it.
a. Add all the conditions in the Expression builder of the Declare Expression.
b. Create a When rule and add the boolean property 'Test' in the When rule.
- Use this When rule in the Local action for the Submit button. Despite using this change, a Refresh action must be add on the Autocomplete property error code after the Post Value.
Published July 17, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.