web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans