Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

recalculate Rollup Fields automatically

Posted on by 215

i want to use this link:
santoshmscrm.wordpress.com/.../force-recalculate-rollup-fields-in-ms-crm-2015-programatically

how i must use it by create "post-entity-update" plugin ?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: recalculate Rollup Fields automatically

    Having the same error when the workflow runs...

    'new_rfc' entity doesn't contain attribute with Name = '1'.

    name is always equal to "rollup field value"

    Is "Force Calculate Rollup Field" has bug?

     


    Can anyone help resolve this?

  • Muthuraman144312 Profile Picture
    Muthuraman144312 170 on at
    RE: recalculate Rollup Fields automatically

    Actually i am also facing the same Issue. Can you please suggest how you resolved this issue

  • ehsan af Profile Picture
    ehsan af 215 on at
    RE: recalculate Rollup Fields automatically

    problem solved .

    thanks for all :)

  • ehsan af Profile Picture
    ehsan af 215 on at
    RE: recalculate Rollup Fields automatically

    'new_rfc' entity doesn't contain attribute with Name = '1'.

    name is always equal to "rollup field value"

    Is "Force Calculate Rollup Field" has bug?

  • ehsan af Profile Picture
    ehsan af 215 on at
    RE: recalculate Rollup Fields automatically

    I used the solution that you inserted the link : (https://github.com/demianrasko/Dynamics-365-Workflow-Tools)

    i put one workflow on activity that use "Force Calculate Rollup Field" on "workflow-tools" solution, when activity update or create.

    and insert "FieldName" and "Parent RecordURL" link to related my entity that contains rollup field.

    my rollup field is on my entity that, caculate on activities related to my entity.

  • prt33k Profile Picture
    prt33k 6,907 on at
    RE: recalculate Rollup Fields automatically

    Hi Ehsan,

    The code is having issue - please post your code here.

    Thanks

    Prateek

  • ehsan af Profile Picture
    ehsan af 215 on at
    RE: recalculate Rollup Fields automatically

    Sync workflow failed with error message - Unhandled Exception: Microsoft.Crm.Workflow.Services.InvalidCustomActivityExecutionException: 'new_rfc' entity doesn't contain attribute with Name = '1'.

      at System.Activities.WorkflowApplication.Invoke(Activity activity, IDictionary`2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout)

      at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictionary`2 inputs, TimeSpan timeout, WorkflowInstanceExtensionManager extensions)

      at Microsoft.Crm.Workflow.SynchronousRuntime.SynchronousWorkflowActivityHost.ExecuteWorkflowUsingInvoker(Activity workflow, ICommonWorkflowContext context)

      at Microsoft.Crm.Workflow.SynchronousRuntime.SynchronousWorkflowActivityHost.StartWorkflow(WorkflowActivationData activationData, ICommonWorkflowContext context)

    , error code - -2147220891

  • Verified answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: recalculate Rollup Fields automatically

    CRM product calculate rollup using a job in every 12 hr. It doesnt happen synchronously.

    If you want the value to get rolled-up synchronously then you need to write plugin code. The code need to trigger when the child entity gets  created/updated(Post CREATE/Update).

    So if the amount field on account get rolled-up values from all the opportunities then you need to write a Post-Update plugin on opportunity which will calculate the rollup value as shown in the link you shared.

    but when i create plugin which message should I choose? ( assign, create, retrieve, revoke access, update,  ... ) .

    CREATE and UPDATE

    and which message should I choose for pipeline stage? ( pre-validation, pre-operation or post-operation )

    POST

    and execution mode asynchronous or synchronous ?

    SYNCHRONOUS

    You can use solution here and this will save you from coding: github.com/.../Dynamics-365-Workflow-Tools

  • ehsan af Profile Picture
    ehsan af 215 on at
    RE: recalculate Rollup Fields automatically

    I'm really confused I tried it but it does not work.

  • Verified answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: recalculate Rollup Fields automatically

    If you want to recalculate the fields, you need an event to be triggered that would call the code to recalculate.

    That event has to be one of the triggers that I mentioned above.

    You can't have this run automatically unfortunately. That is by design. It will run after 12 hours.

    To make it run, you would have to add code that would call the CalculateRollupFieldRequest/Response classes.

    As I mentioned above, you would need to add the code to recalculate on the Create, Update and Delete Steps of the entity.

    If this is for activities, you would have to add the steps to your activities, and verify that the regardingobjectid type is your entity.

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