Search code examples
dynamics-crm-2016

Rollup field in Dynamics CRM 2016


Is there a way to force a rollup field to do it's calculation rather than having to "refresh" the field on the form?


Solution

  • You can use CalculateRollupFieldRequest in plugin when component field is updated:

    CalculateRollupFieldRequest request= new CalculateRollupFieldRequest
    {
        Target = new EntityReference("<entityname>", recordId),
        FieldName = "<rollup field to refresh>"
    };
    
    CalculateRollupFieldResponse response = (CalculateRollupFieldResponse)service.Execute(request);