Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Update field with its current value using an on-demand workflow

(0) ShareShare
ReportReport
Posted on by 154

Basically, I have a date field that when it is updated (onChange event) automatically populates two other fields: one field is the month and the other is the year. I'm doing this with JS in a web resource since it requires taking the date field and using .getMonth() and .getFullYear() methods.

This works fine on new records, but I need to update old records and going into each one, updating the date, isn't really an option. Thus, I'm trying to make an on-demand workflow that I can select the records in a view and run the workflow on just those. 

I'm not quite sure how to setup the workflow though.

  • Create Process
  • Category = Workflow; Entity = the entity I'm working with; Type = New blank process
  • Check "As an on-demand process"
  • Start when = "Record fields change"
  • Select the field to look for changes on ("Date Proposal Sent")
  • Add Step > Update Record > Set properties

From there I am kind of lost as to how to set the field to its current value. Also, now that I'm thinking about it, this might not trigger an onChange() event since I guess it isn't technically changing.

Should be handling this a different way? If not, how do I continue to set this up?

*This post is locked for comments

  • Verified answer
    Kokulan Profile Picture
    18,052 on at
    RE: Update field with its current value using an on-demand workflow

    Hi

    Your approach should help to resolve your issue, its a good start. Please see below as to how you can create the workflow to do what you want.

    Since you are only using this workflow to update existing records, the workflow does not need to trigger on any record events. You will be triggering the workflow from advance find.

    First of all, to get Month and Year from DateTime value, there is no out of the box feature in workflow designer. You can use third party solutions, following is one of them.

    [View:https://github.com/jlattimer/CRM-DateTime-Workflow-Utilities/releases/tag/v2.3.0.0]

    Download the CRMDateTimeWorkflowUtilities_2_3_0_0_managed.zip solution and import onto your CRM instance.

    You can then create the workflow as shown below

    [View:/cfs-file/__key/communityserver-discussions-components-files/117/ScreenClip-_5B00_623_5D00_.png]

    Once you created and Activated the workflow, you can run this from Advance Find results window

    [View:/cfs-file/__key/communityserver-discussions-components-files/117/ScreenClip-_5B00_625_5D00_.png]

    If you have under few thousands of records, you could increase the page size to 250 in Personal Settings area and run this workflow against the records returned in Advance find.

    But if you have loads of records, meaning over 5K, you could use the XrmToolBox plugin to run the workflow against  the records. You can download the FETCH XML from advance find and paste the FETCH query in this tool and run the workflow against all the records in batches.

    [View:/cfs-file/__key/communityserver-discussions-components-files/117/ScreenClip-_5B00_627_5D00_.png]

    Let me know if you need any further help or guidance on this.

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…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,978 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,821 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans