Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically finishing business process flow in Dynamics CRM 365

I am managing the whole CRM process flow in C# code, using the newest SDK version (8.2). Moving forward works fine, simply by updating the stageid on the relevant entity. However I have no idea, how could I finish the last stage = how could I set process to finished. I'd like to call exactly the same actions as with clicking the button "set finished"

like image 393
Jan Avatar asked Oct 21 '25 12:10

Jan


1 Answers

To set the current status of the active process instance to finished use:

Xrm.Page.data.process.setStatus("finished");

From the Microsoft documentation:

Xrm.Page.data.process.setStatus(status, callbackFunction);

status is a string that can be active, abandoned or finish. callbackFunction is an optional function to call when the operation is complete.

Note: though the documentation says to use finish this does not work: use finished.

like image 159
Dave Clark Avatar answered Oct 23 '25 06:10

Dave Clark