Hi Experts,
I am creating an App which will create new sales order in Dynamics 365FO, and so far with help of community and forums I am progressing well on it. (Still new to the world of PowerApps and Flow).
Automatic number sequence is setup in D365 for the SalesOrders entity and I need to tell the app to use it when generating new number, but I am currently stuck on it.
Let me describe the whole scenario, maybe you can point out something i did wrong.
The App is really simple as concept. It containts 2 Edit Froms in which I have used the Dynamics 365 Fin Ops connector in order to get the 2 tables which i need "SalesOrderHeadersV2" and "SalesOrderLines".
I have selected few fields which I need for the end user to fill in.
Here is how it looks:
And for the functions I have done the follwoing:
Set the button's OnSelect Property to SubmitForm(F_SalesHeaderV2)
OnSuccess property of that form is set to SubmitForm(F_SalesLines)
OnSuccess property of sales lines will reset both forms to allow next SO and Line to be created. So I set it to ResetForm(F_SalesHeaderV2); ResetForm(F_SalesLines)

I am not looking for manual generate of SO number, I want the data field from the app to communicate with the number sequence(how it is usually the standard process in Dynamics) and automatically generate new number when the sales order is being submitted/created from the App.
Unfortunately I cannot accomplish this now and it is real struggle for me. Maybe there is something that I am doing wrong.
For the same thing I was suggested to Default the value of SalesOrder with the following formula : F_SalesHeaderV2.Lastsubmit.SalesOrderNumber - which dosen't work, and the second suggestion was to add +1 to it, which I am not sure how is done.
As well I cannot ignore the filed in the App, as it is one of the 2 mandatory fields one you add the table , so I can only hide it , but it still needs to function within the app.
Any suggestions will be Highly appreciated.