My data source for my Powerapp is D365FO. My goal is to allow users to create purchase requisitions via powerapps (but this can be valid for purchase orders, expense reports...etc). I created a gallery which displays current purchase requisitions, I can update them - that works fine.
The issue is when I want to create a new purchase requisitions. The issue is that D365FO requires a number sequence number for the purchase requisitions. However:
1) When I do not enter the purchase requisition number, D365 says "invalid..." it simply wants the purchase requisition number.
2) When I enter the proper purchase requisition number, which is e.g. 000023 (current purchase requisition number is 000022), then it says I am not able to assign this number, because D365 needs to generate its own number...
3) I thought I would set the number sequence to manual, but funny thing, I cannot find the number sequence setup.
My question is how to deal with this? Is there a function which will fetch the next number to powerapps and then uses it to create the record in D365FO?
I don't know D365FO at all, but I assume this might be due to the fact that you're not allowed to set custom primary / foreign keys yourself. E.g. your purchase requisition number needs to be generated by the system, not by you.
I assume it is the same/similar in D365FO as it is in SharePoint. If you'd like to create a new record, you'd need to use Defaults('<source>')
Since your source is D365FO, perhaps you could try to use Defaults(D365FO) for the purchase requisition number. That might solve your problem.
I hope this helps.
I am not sure what you mean by your suggest solution. I can imagine it is a difficult scenario, because in D365FO, you must click "New" and then the system assigns you a number from the number sequence. However in PowerApps, if you click "New", D365FO does not yet know you clicked New, so how could it give you a number sequence number..
Maybe PowerApps are not meant for creating such records.
Sorry for my late answer. Unfortunately not. The answer will be Dual Write I think. Try looking into that. There are some videos on youtube about that.
Check out new user group experience and if you are a leader please create your group
Check out how to claim yours today!
Test your skills now with the Cloud Skill Challenge.
We are excited to announce that Demo Extravaganza for 2021 has started!