Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Get New Opportunity Id from Action

(0) ShareShare
ReportReport
Posted on by 1,875

Hi

I have put custom button on command bar name Clone Opportunity. I have created an action that will clone the opportunity. I will call this action from custom button. How do I return newly created opportunity record ID in Action. What data type of output variable do I create and how do i set its value?

*This post is locked for comments

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Get New Opportunity Id from Action

    Hi, Just as Ravi said you can use an EntityReference, or even a string containing the Guid of your newly created record.

    You would then need to loop in your success callback function through the list of parameters, and get the result that you are passing back from the action.

    If you use process.js to call your actions, then your logic would look something like this:

       Process.callAction(messageName, inputParams,

       function (params) {

           // This is your success result, where you would get the Guid of your action from

           var result = "";

           for (var i = 0; i < params.length; i++) {

               result = params[i].key + "=" + params[i].value + ";";

           }

           alert(result);

       },

       function (e, t) {

           // Error

       });

    You can find process.js here:

    processjs.codeplex.com

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Get New Opportunity Id from Action

    Hi,

    You would need to use the Entity Reference as the data type for your output parameter which can be set by Assign step.

    Refer following links-

    crmtipoftheday.com/.../add-variables-to-your-workflows

    community.dynamics.com/.../156401

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans