Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Cloning records and Calculated Fields Recalculate Automatically

Posted on by 9
I am working with cloning records. In my example, I am cloning a bunch of records using the new workflow utility. This works fine, except the cloned records have calculated fields on them that require a re-save after create (the calculated fields on the cloned records are blank until then). Does anyone know of a way to force a record recalculate automatically? 

*This post is locked for comments

  • Suggested answer
    Inogic Profile Picture
    Inogic 24,094 on at
    Cloning records and Calculated Fields Recalculate Automatically
    Hi Weldarb,

    While the new workflow utility in Dynamics 365 CRM doesn't natively trigger a recalculation of cloned record fields, here are two approaches to achieve this:

    1. Workflow with Update Step (Simple Scenario):
    This method works well if the calculated field formula is relatively straightforward and doesn't involve complex dependencies.
    • Create a workflow that triggers on record creation (of the entity being cloned).
    • Within the workflow, include an "Update Record" step targeting the newly cloned record.
    • In the update step, map a dummy field (e.g., a hidden text field) to any value (e.g., "trigger recalculation"). This minor change will trigger recalculation of all formula-based fields on the record.
    2. Click2Clone app by Inogic [Certified Software on Microsoft AppSource]:
    Checkout Click2Clone app by Inogic for cloning Dynamics 365 CRM records, it can help you automatically clone records with their calculated fields. With Click2Clone, you can clone Dynamics 365 CRM records for Dynamics 365 CRM entities (OOB or Custom). You can effortlessly create multiple copies of any given CRM record, along with their related child records. This way, the app saves you time by automating the process of manually cloning records.
    Here are the key features of the Click2Clone app:
    • One Click Cloning: Clone existing records along with their notes, attachments, and custom fields with just a click of a button.
    • Automate Cloning: Set up workflows to clone records automatically based on your needs.
    • Clone Records Across Entities: Easily clone records from one entity to another (e.g., Opportunity) to another (e.g., Order).
    • Deep Clone Hierarchies: Clone entire groups of related records at once, ensuring data accuracy.
    • Copy Child Records: Quickly copy related/associated child records within the same entity.

    There is much more to Click2Clone’s amazing features.

    If you are interested in trying the app for your CRM record cloning needs, then you can get it for a 15-day free trial from our Website or Microsoft AppSource.
     
    Thanks,
    Sam
  • Hankanman Profile Picture
    Hankanman on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    Hi Alex, I tried that and as an on-demand, doesn't trigger the calculation, im on dynamics 2016 on-prem, hopefully we will be on dynamics 365 on-prem by end of next week

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    I'm wondering, then.. what if you  registered a workflow to run "oncreate" of those entities? That would be an equivalent of having a "retrieve", and you don't need to do much there (maybe just add a step to stop the workflow..)

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    I asked that question because I tried exactly that scenario, but, admittedly, in 365.. If I use a workflow to create a record which has a calculated field, that field seems to be populated correctly.

  • Hankanman Profile Picture
    Hankanman on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    Because the record is being 'cloned' ie created by a workflow, the calculation isn't performed. You can see this by running an advanced find on the cloned records and the calculated field will be shown blank, and subsequently you cannot run any other workflows against that field because its blank.

    Yes the field is calculated when it's retrieved but that only seems to mean 'when someone opens the record' as soon as you open a cloned record fully, the field is calculated.

    This presents a problem because it means you can't clone records because resulting calculated values will always be blank, unless you force the user to open the record.

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    Hi Wal,

      are those calculated or rollup fields?

        https://msdn.microsoft.com/en-us/library/dn817863.aspx#BKMK_Calculated

        "Calculated attributes are calculated in real-time when they are retrieved."

      

    What does it look like - how do you know they are empty? 

      

      

  • Hankanman Profile Picture
    Hankanman on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    Will this work for calculated fields as well as rollups then?

  • BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    Hi,

    Have a look at this set of custom workflow activities:

    msdyncrmworkflowtools.codeplex.com

    There is a Force Calculate Rollup Field step in the solution

    Regards

    Bharat

  • Hankanman Profile Picture
    Hankanman on at
    RE: Cloning records and Calculated Fields Recalculate Automatically

    Hi Weldarb, I have exactly the same issue, did you find a solution? Ill post here if i figure it out.

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans