Hello, I need to update a custom rollup field automatically created in cases. It calculates the time of a case after posting on a service appointment. I mean, when a service appointment is created, updated or deleted; time changes in the case.
I tried with calculaterollupfieldrequest, but I have constantly bugs or nothin happens in the crm.
Just use this workflow utility is very helpful :
The syntaxt of calculaterollupfield message is simple. Refer below-
CalculateRollupFieldRequest crfr = new CalculateRollupFieldRequest
Target = new EntityReference("new_class", classId),
FieldName = "new_totalstudents"
CalculateRollupFieldResponse response = (CalculateRollupFieldResponse)service.Execute(crfr);
Alternatively as suggested above, you can use Dynamics 365 Workflow Tools and use the pre-built activity to calculate rollup fields. This tool can be usefull for other needs as well if required.
Hope this help
Business Applications communities