Execute WorkFlow using Xrm.WebApi in Dynamics CRM Version 9.0

A very interesting read from my colleague

Chandana's CRM Blog

It has been a long time that I have contributed to the blog posts :(. Well I have started again to tell some interesting things. Recently I started working on Xrm.WebApi CRUD operations wherein I have a requirement to send email when invoking a custom ribbon button.

So to implement the same I have created an on demand workflow on account entity as shown here


Now I tried to invoke my workflow from the custom ribbon button using

Xrm.WebApi.execute(request).then(successCallback, errorCallback);

Prepare request object similar to this to execute your workflow as shown below

var request = {};

//pass workflow Id and entityType as worflow
request.entity = { id: “cd78cbcc-080a-4a48-8b9d-46555b655c02”, entityType: “workflow” };

//pass record Id of type Guid ,here my workflow is on “Account” entity

request.EntityId = { guid: “A16B3F4B-1BE7-E611-8101-E0071B6AF231” };
request.getMetadata = function () {
return {
boundParameter: “entity”, /
operationType: 0,

//operation name is always “Execute Workflow” independent of…

View original post 115 more words

Author: 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