web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Best way to trigger custom workflow

(0) ShareShare
ReportReport
Posted on by 12,119 Moderator

Hi all

I have a button from which I want to trigger custom workflow. I know How to trigger custom workflow with the help of workflow? but I want to know the best way?

Thank You

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Alagunellaikumar Profile Picture
    6,212 on at
    RE: Best way to trigger custom workflow

    Hi

    use process.js

    processjs.codeplex.com

    community.dynamics.com/.../143712

  • Suggested answer
    Shidin Haridas Profile Picture
    3,497 on at
    RE: Best way to trigger custom workflow

    Hi Abdul,

    1. The recommended way would be to create a custom action and trigger it using JavaScript as recommended by Nadeeja.

    2. You can also use 3rd party libraries, such as 'Process.js', as suggested by Nithya. But you will have a dependency on a 3rd party library, if you choose this method. And since, 'Process.js' is relatively new, I would not suggest this.

    3. Another easy way would be to create a dummy field and have it on your form, but hidden. Modify your workflow to be triggered on change of this field.

    So, your JavaScript modifies this field -> the field change triggers the workflow.

    4. There is a new feature in 'Ribbon Workbench' by Scott Durow, called 'Smart Buttons'. I have not worked much with them. But I believe they can be leveraged for your scenario.

  • Verified answer
    Shidin Haridas Profile Picture
    3,497 on at
    RE: Best way to trigger custom workflow

    Hi Abdul,

    1. The recommended way would be to create a custom action and trigger it using JavaScript as recommended by Nadeeja.

    2. You can also use 3rd party libraries, such as 'Process.js', as suggested by Nithya. But you will have a dependency on a 3rd party library, if you choose this method. And since, 'Process.js' is relatively new, I would not suggest this.

    3. Another easy way would be to create a dummy field and have it on your form, but hidden. Modify your workflow to be triggered on change of this field.

    So, your JavaScript modifies this field -> the field change triggers the workflow.

    4. There is a new feature in 'Ribbon Workbench' by Scott Durow, called 'Smart Buttons'. I have not worked much with them. But I believe they can be leveraged for your scenario.

  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: Best way to trigger custom workflow

    Hi Abdul Wahab,

    You can download the Process.js library from the link below which contains the method Process.CallWorkflow.

    See: https://processjs.codeplex.com/

    Try the code below.

    Process.callWorkflow("4AB26754-3F2F-4B1D-9EC7-F8932331567A", 
        Xrm.Page.data.entity.getId(),
        function () {
            alert("Workflow executed successfully");
        },
        function () {
            alert("Error executing workflow");
        });

    Hope this helps.

  • Verified answer
    Nadeeja Bomiriya Profile Picture
    6,804 on at
    RE: Best way to trigger custom workflow

    Hi Abdul,

    You can create a custom action and call it using JavaScript.  Inside custom action you can call the workflow.

    debajmecrm.com/.../invoke-your-custom-action-from-dynamics-crm-web-apidynamics-crm-2016

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans