This should be pretty basic but I cannot figure out the correct order of syntax for On Select. Example, on "EditFormNew" I have three bottons:
Button 1: Save the data then return to a blank "EditFormNew" so the user can add another entry
Button 2: Save the data but open up a blank "EditFormUpdate"
Button 3: Just save the data and return to "BrowseScreen1"
If the buttons cannot return to the form or need to include the screen name, just replace EditFormNew with EditScreenNew and EditFormUpdate with EditScreenUpdate. Do I need to do anything with OnSuccess/Failure?
To do what you want, you will want to use both the OnSuccess and OnFailure.
In your Button(s), you would call your Submit Form.
In the OnSuccess you will do your Reset(form) and to set the form to what you want it to be (new/update/edit etc)
My recommendation is that in the OnVisible of this screen you set some variable like
Set(_saveType, 0);
Then in the buttons, you can do Set(_saveType, 1 or 2 or 3)
In the Forms OnSuccess, you would have a switch
Switch(_saveType,
1,
Add save add another code,
2,
Add Save/Modify Existing,
3,
Save and Exit where you will simply d your Navigate(SomeScreen),
);
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.