Call Workflow directly from a button using Ribbon Workbench

Posted On May 25, 2018 by Clinton D'Mello Posted in  Tagged in

Introduction:

In this blog we will demonstrate how to call a workflow directly from a button without any custom JavaScript code.

Implementation:

Step 1: Create the required workflow. In this example i have created a  simple workflow on the opportunity and remember to select the  “As an on-demand process” option.

Step 2: After the workflow is created store the GUID of the workflow. To get the GUID  select the workflow and copy down the ID from the URL as shown in the below image.

Workflow GUID

Step 3: Now create the custom button on Opportunity entity using Ribbon Workbench.

Step 4: Create a new Command and click on “Add Action>JavaScript Action” as shown in the image.

JavaScript Action

Step 5: In the library option write the following “/_static/_forms/form.js” and in the Function Name field “Mscrm.FormAction.launchOnDemandWorkflowForm“.

Ribbon Workbench Pararmeters

Then as shown in the above image add two Parameters as follows:

  1. Crm Parameter = PrimaryEntityTypeCode
  2. String Parameter = “GUID of the Workflow”.

Step 6: For the final step add the command to the newly created button by simply selecting it from the drop down in the properties section.

Ribbon Workbench Button Command

Step 7: Now when we click on the button that we created we get the following message.

Workflow Confirmation

On clicking OK the workflow will run. This is a helpful as it can be done quickly without using any custom code.


Share Story :

SEARCH BLOGS :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange