Pass Parameter from CRM Command bar Button with Javascipt

Passing a Parameter on a Button Click is useful if you want to execute a custom Workflow or Action by accepting parameters when the button is clicked, as you will want the behaviour for each button to perform a different request, so setting the parameter for each button allows the user to execute tasks using Actions, Workflows or Customs plugins and integrations.

1) Once you have created your new button in RibbonWorkbench, right click the button and Click Customise Command

2) Find the Customise Command for the button you just created, Right Click on the Customise command and select Edit Actions

3) Click Add button, and add the: JavaScript Function Action as shown below;

4) Add a Javascript Function Action and set the following;

·        Provide Function Name: The Function being called in the Javascript WebResource

·        Web Resource : The JavaScript Webresource

·        Parameter: the Parameter that is being passed to the Function

Click OK and click publish

PS . The JavaScript Web resource can then be used such as to Pass Parameters to execute an Action Process or trigger Workflow Activity etc.



mm
Author: Raz Dynamics
Razwan is a Microsoft MVP and Dynamics 365 Community Moderator responsible for developing Microsoft Dynamics 365 and CRM integrated solutions for over a decade. Razwan is responsible for delivering Dynamics 365 User Groups & CRM Saturday Conferences. Raz has developed many free community utilities for Dynamics 365 and CRM which you can download from this blog.