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 :
Customer Service forum

Redirect to record created by workflow

(0) ShareShare
ReportReport
Posted on by

I am using a workflow to create a record.  How do i pass the ID of the newly created record when i redirect after successful execution of the workflow?

Also im am doing this in a portal

Categories:
I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    Could you kindly share your requirement with more details?

    If you only want to get the new GUID, you could add js code to "onLoad" event of the entity form which you want to create and then save the record to a field so that you could use it as you wish.

    You could refer to this similar post.

    community.dynamics.com/.../159157

    In addition, could you kindly share more information about your requirement? Why do you want to pass the new GUID after creating the record.

    Hope it helps.

    Best Regards,

    Leo

  • Dynamics365 Rocker Profile Picture
    7,755 on at

    Where do you want to pass newly record id?

  • Verified answer
    Community Member Profile Picture
    on at

    Hi CRMer,

    You can do so in CRM & Portal but you need some coding and workaround.

    Let's say we have record in entity A. When status of Entity A changes to X, you need to create an SMS, and redirect CRM to this SMS.

    To achieve this, you need to use an Action process, and a custom activity. The Action process will have the needed input as per your requirement, and an output param called "SMSGuid".

    Add the custom activity which creates the SMS as a step to the Action process. Call this action process using WebAPI JavaScript on entity A form on status change, and on execution success, open the created entity using its Guid that's returned by the Action process, below is the code.

    var entityFormOptions = {};

    entityFormOptions["entityName"] = "new_sms";

    entityFormOptions["entityId"] = SMSGuid; // "8DA6E5B9-88DF-E311-B8E5-6C3BE5A8B200"

    // Open the form.

    Xrm.Navigation.openForm(entityFormOptions).then(

       function (success) {

           console.log(success);

       },

       function (error) {

           console.log(error);

       });

     

    Hope it helps! If it does, please mark this answer as Verified, this will be greatly appreciated :)

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans