im creating an app connected with SharePoint list in a single screen called (HomePage)
When i click on "Enregistrer" (means save), he's saving the data in the sharepoint list and he give me this :
in the OnSelect i put : SubmitForm(Form)
What i want is when i click on "Enregistrer" , i want him to save and go back to the same page with a new form.
How can i do that ?
Yes you can do that, you need to update the OnSuccess property of your form to :
That basically means, when the submission is successfull, make my form ready for a new item creation.
It is better to put the NewForm() function on the OnSuccess property of the form like I've suggested because you don't want the user to loose all what he has filled in if the submission fails.
I'm not you need to sure Reset() IMHO because with the NewForm() you're already resetting his Mode that should reset the controls ?
It goes in whatever order you put so as long as you put the Submit first it should be good......but either way works I suppose.
It depends on what fields you are doing whether you need the Reset in there....I have some with RadioButtons and checklist and stuff like that and without out it doesn't seem to clear that out. There is extra code I can put in there to force it but I just use the ResetForm to cover the basis and saves me time. Just have to remember to use it BEFORE the NewForm part or it will change your FormMode from New to Edit (been there, done that!).
Yes it goes in the order of the formula. But if the NewForm function is right after the SubmitForl function, the app will chznge the form mode even if the submission fails, and this is not a correct behavior, if the submission fails the user should stay on the form he has filled in, correct his error and resubmit it. That's why using the OnSuccess property is better.
Haven't tried for radio and checkbox so you may have a workaround. But resetting the form control before changing the mode can be a bed idea if your default value on your controls is conditional to the mode.