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 :
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

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 49 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 27 Most Valuable Professional

#3
Soundari Profile Picture

Soundari 15

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans