Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Updating a record field when that record is cloned using workflows

Posted on by 777

Hello,

First question:

I have a 2 option set field called "refill in progress" with either "yes" or "no" values, the default value being "no."

When I clone a record, I would like this field to be updated to "yes." Any resources on how to do this with a workflow? 

Second question: 

Would it be possible, using workflows, to have that field changed from "yes" back to "no" if the cloned record is deleted? This isn't as important, but would be nice if it's simple enough to do.

Thank you! 

*This post is locked for comments

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Updating a record field when that record is cloned using workflows

    Hi Ben,

    Basically, you need to have a field which you will populat withe the parent record whilecreating the child cloned form. And you you need to use the same field in the workflow logic.

    The screenshot looks fine if you are populating that field with the value.

    Hope this helps.

  • Ben T Profile Picture
    Ben T 777 on at
    RE: Updating a record field when that record is cloned using workflows

    2072.workflow1.PNG

    Ravi,

    Your solution worked very well. A little bug with regards to interacting with dashboard is happening, but that's another topic. The workflows are working well. Also, what check condition would you have used to check if the record being created is a cloned record??

    I am attaching my workflow so you can see, but I checked if the "cloned from" form had no data, and if not, then stopped the workflow, and if so, then the workflow could proceed. Is there another way to check if a record is a cloned record or not?

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Updating a record field when that record is cloned using workflows

    Hi Ben,

    Please check below link,

    community.dynamics.com/.../264609

    You need to code a plugin for it and a custom button using ribbon workbench.

    1) Add a custom button using ribbon workbench

    2) Call a javascript from it

    3) Create a action which will be called from Javascript.

    4) With the action name, message will be created in Plugin registration tool, with the help of the message, you can call plugin on button click and set the option set value to "YES".

    5) On delete also you can code a plugin and check your condition for setting the field value to "No".

    Best Regards,

    Shahbaaz

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Updating a record field when that record is cloned using workflows

    Hi Ben,

    Suggestion to both pf your questions depends upon how are you cloning a record? Basically while closing a record, in a cloned record, if you are saving the actual record reference (say something like a lookup field "Cloned From") then you can create a workflow, trigger it on create, check if the record being created is a cloned record, if it is cloned record, update the Cloned From record and set the value to 'Yes'

    Similarly, you can have another workflow which will trigger on delete of the record, you will check if it is a cloned record, if yes then again update the Cloned From record and set the value back to 'No'.

    Hope this helps.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans