Notifications
Announcements
No record found.
i want to use this link:santoshmscrm.wordpress.com/.../force-recalculate-rollup-fields-in-ms-crm-2015-programaticallyhow i must use it by create "post-entity-update" plugin ?
*This post is locked for comments
If you have Visual Studio, you can download the XrmToolkit to simplify the creation process of Plugins, you can use XrmToolkit.
You ca download Xrm Toolkit from here:
https://xrmtoolkit.com/
It has documentation on how to create Plugins, and other parts of CRM. Link below is on creating a plugin
xrmtoolkit.com/.../PluginWizard
If you don't have Visual Studio you can download the community edition of Visual Studio for free.
The article that you linked above should give you enough in order to get a plugin up and running.
Good luck.
All is ok.
but when i create plugin which message should I choose? ( assign, create, retrieve, revoke access, update, ... ) .
My guess is the "update" for this project
and which message should I choose for pipeline stage? ( pre-validation, pre-operation or post-operation )
My guess is the "post-operation" for this project
and execution mode asynchronous or synchronous ?
My guess is the "synchronous" for this project.
Please confirm me for "recalculate Rollup Fields automatically" plugin
It would have to be on the Create, Update (by attribute) and Delete of the child entity (the entity which you are going to sum up the values on). Basically the recalculation will have to happen every time there is a change to the totals, so new record, update of amount in existing record, or deletion of record (if you allow it).
Remember that calculations automatically happen every 12 hours.
ok
but I want to recalculate Rollup Fields automatically happen when any change occurs in the sub-entity (activities related to my entity).
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.
I'm really confused I tried it but it does not work.
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.
CREATE and UPDATE
POST
SYNCHRONOUS
You can use solution here and this will save you from coding: github.com/.../Dynamics-365-Workflow-Tools
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
Hi Ehsan,
The code is having issue - please post your code here.
Thanks
Prateek
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.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2