Skip to main content

Notifications

Announcements

No record found.

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 !

  • 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!

  • 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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,001 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,837 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans