Jan
Jan

Reputation: 137

Dynamics 365 - Order of steps in Business Process

I am trying to retrieve business process flow using RetrieveActivePathRequest as in documentation https://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.retrieveactivepathrequest.aspx

It works, although I am not sure, wheater the stages I got in return, are guaranteed to be in correct order (as in process flow). It seems to be so, but I would prefer not to trust it blindly. Can anyone confirm? Or if not how can I get them in correct order?

Upvotes: 1

Views: 474

Answers (1)

Conor Gallagher
Conor Gallagher

Reputation: 1499

The business stages order are an oddity indeed. It should match the order within the response. I only say should because I have yet to see it documented anywhere, but here's my reasoning as to why there's a good reason to trust the order.

The business processes are stored as XML (like all workflows are) as opposed to in a SQL table as records. So you're not bound by the potential randomness of a SQL table. So, it's pretty reasonable to presume that it will be in correct order as it is read into any list. Therefore it should be in the correct order within the response.

On saying that, I'm a skeptical individual and I don't know what sort of shenanigans are going on in the background. So what I recommend you also do is use the stage category in conjunction with it. Just make sure you assign categories in the correct order to the business process stage. Then you can simply order by the stage category to be doubly certain.

Upvotes: 2

Related Questions