Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Calling a Workflow from JavaScript with no Parameters

(0) ShareShare
ReportReport
Posted on by 6

Hi,

I have a workflow that takes no parameters that is triggered from the a main entity (let's call it "entityfoo").

When you got to the main page for "entityfoo" - I have a button that I want people to be able to click that calls an async workflow that goes off and populates records into "entityfoo".

This workflow is not tied to a specific entity record, it simply populates the list.

How can I call this workflow in D365?  I vaguely remember doing this before using the "Run Workflow" command in the non-unified interface but this doesn't seem possible now.

Is this possible and if not how do I trigger a workflow in this manner?

(It doesn't have to be a button or javascript, happy with whatever can work).

Thank you - Greg.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Calling a Workflow from JavaScript with no Parameters

    If you are looking for "Run Workflow", it has been moved under the Flows which appears when you select an existing record. Refer below screenshot-

    pastedimage1624234993422v1.png

  • Suggested answer
    Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Super User 2024 Season 1 on at
    RE: Calling a Workflow from JavaScript with no Parameters

    It is mandatory to pass record id to trigger workflow. This id must be a GUID of an entity record you had selected while creating your workflow.

    Since the functionality of this workflow is to create records, you can convert the records creation logic from workflow to javascript so that, upon button click, javascript will directly create the records without triggering workflow.

  • IAmGreg Profile Picture
    IAmGreg 6 on at
    RE: Calling a Workflow from JavaScript with no Parameters

    But this requires an entity id to be present.

    In my case, there are no entity records populate, my workflow populates the records.  

    I've tried modifying these code snippets without entity id and they all generate errors.

    My workflow does not require any input parameters.

  • Suggested answer
    Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Super User 2024 Season 1 on at
    RE: Calling a Workflow from JavaScript with no Parameters

    Hi Greg,

    Check below link to trigger workflow from javascript. When the button is clicked, you should be able to get all the selected record IDs and loop through each IDs to trigger workflow.

    www.inogic.com/.../

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans