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 

I have the same question (0)
  • Verified answer
    LeoAlt Profile Picture
    16,331 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,331 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
11manish Profile Picture

11manish 36

#2
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 32

#3
Goloknath Profile Picture

Goloknath 28 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans