web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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 

  • Verified answer
    LeoAlt Profile Picture
    16,341 Moderator on at

    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

  • Ashok Chauhan Profile Picture
    5 on at

    Thanks for the solution. This worked perfectly

  • LeoAlt Profile Picture
    16,341 Moderator on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
11manish Profile Picture

11manish 50 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 45

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 18

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans