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 :
Customer experience | Sales, Customer Insights,...
Answered

How to trigger Workflow in JavaScript from Ribbon Button

(0) ShareShare
ReportReport
Posted on by 15

Hello Community,

I would like to ask how I am able to trigger my workflow when I click on my Ribbon Button in the record view list?

My requirement:

The customer wants me to implement the feature that, If the user selects at least 2 forecast records in the record view list, then the Ribbon Button called "OK" appears in the ribbon.
If the user clicks the OK Button, a workflow will be triggered which then changes the "Ok"-Column value in the view from "No" to "Yes".

What I have done so far:

- I created the Ribbon Button in the RibbonWorkbench.

- I associated the Command Rule with the needed JS scripts and added it to the OK Button.

- I added Enable Rule to the OK Button

- I created the Workflow

It looks like this:

The Workflow:

pastedimage1606315099893v1.png

The JavaScript function (As you can see here I provided a hardcoded GUID of Workflow, but I just copied this GUID from a similar function above.)


My question here specifically: If I copy the GUID of the Worfkflow above, which is "210B7CF2-EEB6-4342-AA15-DDC2648BECE3", will it correctly run or do I miss any steps in here overall?


pastedimage1606315131823v2.png

The Ribbon Button:
pastedimage1606315307495v3.png


Thank you !

I have the same question (0)
  • Verified answer
    Madalina Toma Profile Picture
    on at
    RE: How to trigger Workflow in JavaScript from Ribbon Button

    Hi Albert,

    Thank you for posting this question.

    We have an action performing an ExecuteWorkflow request which will help in this case:

    cloudblogs.microsoft.com/.../

    My recommendation is instead of using CallWorkflow, give the ExecuteWorkflow a try based on the documentation above.

    Madalina

  • Albert Schuman Profile Picture
    15 on at
    RE: How to trigger Workflow in JavaScript from Ribbon Button

    Hi Madalina,

    I followed the documentation and adapted your suggestion to my use case. This worked for me, thank you!

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 125

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 110 Super User 2025 Season 2

#3
Erin Lubben Profile Picture

Erin Lubben 73

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans