DYNAMICS CRM DEVELOPMENT: TIPS AND TRICKS

There are a lot of quick ways of doing things in Dynamics CRM but developers struggle with finding how. Today I am going to explain how to call a workflow on a custom ribbon button.

Let’s say you have a situation, where you want to perform some operation on custom ribbon button on “click event”. Let us take an example. I have a button on OPPORTUNITY form called ‘ConfirmRequest’. On the click event of this button I have to generate an ORDER and also want to send an email. The best way to achieve this is by creating a workflow. But the issue is, how to call workflow on the button click.

There are many solutions posted on the web, that involve using JavaScript, web resources etc. however, there is a much easier way that requires no coding.

For this we use Ribbon Workbench. Contact us to find out the right plugin to download.

Here are the steps to follow:

  • Create a workflow, for example – I created a workflow called Generate Order from Opportunity.
  • Extract the GUID of this workflow with the help of advanced find. Here is how you do it:
    • Open advanced find window
    • Look for processes and search for your workflow name

WORKFLOW-PICTURE

    • Export to Excel and extract the GUID of the proceed from the column A called (Do Not Modify) Process.
  • Load the new solution into the Ribbon Workbench with OPPORTUNITY entity.

OPPORTUNITY-ENTITY-PICTURE

  • Expand the commands, “Solution Elements” tab.

SOLUTION-ELEMENTS-PICTURE

  • Right-click on the Command of the custom button that you want to use. Example ‘CCSDP.opportunity.GenerateOrder.Command’ and select ‘Edit Actions’.
  • Add a JavaScript Command and set the following properties:
    Function NameMscrm.FormAction.launchOnDemandWorkflowForm
    Library/_static/_forms/form.js
    Parameters1: Type = Crm Parameter,
    Value = PrimaryEntityTypeCode
    2: Type = String,
    Value = Workflow ID which is extracted from advance find

WORKFLOW-ID-PICTURE

  • Click on OK. And publish it. The workflow will start getting called from the click of the custom button.

Congratulations!!! Now you know how to call workflow from a Custom Ribbon button on Dynamics CRM.

 

Leave a reply

ABOUT US

Soluzione is Microsoft Certified Gold Partner and expert in MS Dynamics 365. We are continuously delivering high quality solutions to various industries and are experts in Microsoft Stack. We also offer Application Development using Open Source Technologies. In addition, we also provide Digital Marketing Services.

 

SEARCH

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

RECENT BLOGS

Archives

F
Contact Us

Verification Image

Enter number from above: