Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Updating field in entity with new GUID value in workflow

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I have a on demand workflow where I need to update a field under accounts entity called "NotificationLinkID" which is a GUID.

Requirement is Every time I run a "On demand workflow", the value in the  NotificationLinkID should be updated with a new GUID value.

How can I achieve above in Microsoft Dynamics CRM Online.

Thanks

Ashok Chauhan 

  • LeoAlt Profile Picture
    LeoAlt 16,331 on at
    RE: Updating field in entity with new GUID value in workflow

    Hi partner,

    If my answer helped, please mark my answer as verified to close this thread and it could help other users with similar issues.

    Have a nice day.

    Best Regards,

    Leo

  • Ashok Chauhan Profile Picture
    Ashok Chauhan 5 on at
    RE: Updating field in entity with new GUID value in workflow

    Thanks for the solution. This worked perfectly

  • Verified answer
    LeoAlt Profile Picture
    LeoAlt 16,331 on at
    RE: Updating field in entity with new GUID value in workflow

    Hi partner,

    Unfortunately, there is no OOB workflow to do this.

    You could create a custom workflow activity to do this and here are the code and results.

    using System;
    using Microsoft.Xrm.Sdk.Workflow;
    using System.Activities;

    namespace CustomWorkFlow
    {
        public class Class1 : CodeActivity
        {
            [Output("newGUID")]
            public OutArgument<string> newGUID { get; set; }
            protected override void Execute(CodeActivityContext context)
            {
                System.Guid guid = new Guid();
                guid = Guid.NewGuid();
                string str = guid.ToString();
                this.newGUID.Set(context, str);
            }
        }
    }

    4251.pastedimage1576573386479v1.png

    After run the workflow, the guid refersh to a new one.

    6518.pastedimage1576573407953v2.png

    About how to set up the custom workflow, you could refer to this blog.

    https://www.c-sharpcorner.com/article/creating-word-counter-custom-workflow-activity-in-dynamics-365/

    Hope it helps.

    Best Regards,

    Leo

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…

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,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans