With latest release of Dynamics 365, Microsoft has restricted skipping BPF stages and throws above error. When we try to change BPF stage programmatically and if we skip any BPF stage, then user will get above error.
Understand the error with the help of an example
Let’s say we have below Business Process Flow on Opportunity.
With D365, only below transitions are allowed.
- Qualify to Develop
- Develop to Propose
- Propose to Close
Below transitions are not allowed.
- Qualify to Propose
- Develop to Close
- Qualify to Close
How my earlier code (prior to D365 release) worked and suddenly stopped working?
Before D365 release by Microsoft, the above scenarios were considered as unsupported and there were no restrictions forced by Microsoft. Hence our code used to work in these unsupported scenarios as well. With D365 release, Microsoft has restricted these unsupported scenarios and users will start receiving the error with same code.
How have I come to this conclusion?
- I got the error log file with error code and same error code (-2146885629) is now available in SDK (you can search in CHM file).
- I raised a support ticket with Microsoft and as per confirmation from MS Support, it has turned out to be by-design. I received below response from MS Support Team.
Note: Even though Microsoft has mentioned Environment as CRM Online, as this is by-design in D365, it applies to CRM On-premise deployments as well.
- After thinking about these unsupported scenarios, it makes sense to use logical branching to skip the stages if needed and if not, then we should follow the path mentioned in BPF.
- The resolution to this issue can be programmatically iterate the record through all the stages or use conditional branching in BPF.