Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

Posted on by 150

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
    Kokulan 18,048 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans