SBX - Search With Button

SBX - Forum Post Title

can´t update automatically rollup fields

Microsoft Dynamics CRM Forum

miugelbma asked a question on 7 May 2019 5:28 AM

Question Status

Suggested Answer

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.

Reply
Anas Rafik responded on 7 May 2019 5:52 AM
My Badges
Suggested Answer

Just use this workflow utility is very helpful :

github.com/.../Force%20Calculate%20Rollup%20Field.md

Reply
Ravi Kashyap responded on 8 May 2019 2:13 AM
Suggested Answer

Hi,

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);

===================

www.magnetismsolutions.com/.../ahmed-anwar&;s-blog/2014/12/01/microsoft-dynamics-crm-sdk-manually-calculate-rollup-fields

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.

github.com/.../Force%20Calculate%20Rollup%20Field.md

Hope this help

Reply
Anas Rafik responded on 7 May 2019 5:52 AM
My Badges
Suggested Answer

Just use this workflow utility is very helpful :

github.com/.../Force%20Calculate%20Rollup%20Field.md

Reply
Ravi Kashyap responded on 8 May 2019 2:13 AM
Suggested Answer

Hi,

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);

===================

www.magnetismsolutions.com/.../ahmed-anwar&;s-blog/2014/12/01/microsoft-dynamics-crm-sdk-manually-calculate-rollup-fields

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.

github.com/.../Force%20Calculate%20Rollup%20Field.md

Hope this help

Reply

SBX - Two Col Forum

SBX - Migrated JS