Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Get Custom Workflow output from JavaScript

(0) ShareShare
ReportReport
Posted on by 678

Hi Experts,

We have a requirement where we need to create a copy of a record. What I did is I created a ribbon JavaScript that calls a Workflow. This Workflow has a Custom Workflow that creates the record and associated record to it.

Now, I want to open the newly created record on click of the button. How do I pass the ID from Custom Workflow back to JavaScript ?

Below is my JavaScript code to call the Workflow. I have a button in Main and in Form.

2018_2D00_09_2D00_19_5F00_12h04_5F00_45.png

*This post is locked for comments

  • Verified answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Get Custom Workflow output from JavaScript

    Workflow is asynchronous and it will not return output parameter in your script. If you make it synchronous then it might help you.

    Otherwise Create an action, Call your custom assembly in it and you will get output parameters in script response.

    If you want to know, How to call an action from script, Please refer below link:

    community.dynamics.com/.../230656

  • Verified answer
    Preeti Sharma Profile Picture
    2,678 on at
    RE: Get Custom Workflow output from JavaScript

    Hi,

    As suggested above custom action can do this for you. Call your custom activity as step in Custom Action and you can get output parameters.

    Thanks.

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Get Custom Workflow output from JavaScript

    Agree with Mahen. You need to create a workflow with output paramters and call your workflow within the custom action and set the output parameters. Something like this-

    6283.customactionactivty.png

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Get Custom Workflow output from JavaScript

    Hi,

    You can't get value from workflow, but you can use action for this and you can reuse your workflow code, in action and action can return you guid of the record which you can open later on.

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... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans