{Dynamics CRM Business Process Flow}Register Business Process Flow StageID and ProcessID in Plugins in CRM 2013

Microsoft Dynamics CRM 2013 introduced the concepts of Business Process Flows. For any entity which have business process flows enabled, CRM creates two fields in the entity

1. stageid

2. processid

On Change of process or stage for an entity, CRM allows you to register workflows. However through plugin registration tool, it is not possible to register plugins on change of stage or process. Also in images for steps you cannot add the processid and stageid parameters during update/ post create of the entity. You have to write separate queries altogether to fetch the processid and stageid for an entity during create/ update of entity in the plugins.

However there is workaround which helps you to achieve all of this in a very simple manner. Let’s see how this can be achieved.

CRM 2013/ 2011 SDK ships with the developer toolkit. Once you install the developer toolkit and open visual studio, you get an option to create CRM Solution. Check for the screenshot below.

screen 24

Just select that and CRM creates a solution for you with the Plugins Class library and also a special type of project called ‘CrmPackage’

Using the CRM Explorer, I have created a plugin on post update of Opportunity.

screen 25

Once the plugin is created, open the RegisterFile.crmregister file in the CRMPackage project. As you can see i have manually added stageid in the filtering attribute and stageid and processid in the post image.

screen 27

All you now need to do is right click the CRMPackage project and select “Deploy” from the menu.

once deploy is succeeded, open Plugin registration tool and you should be able to see the changes.

screen 28

Now as you change the stage of the opportunity, you can see that the plugin is fired and we are able to get the processid and the stageid in the post image.

screen 29

Hope this helps!


About Debajit
I am a Dynamics CRM Most Valuable Professional (MVP) with 12 years of experience in Microsoft .NET Technologies and 9 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: