1
votes

Goal:

Calculate the number of entities related to an entity using roll up field

In our Dynamics 365 online instance, We've implemented 1:N relationship between the out of box Project entity and custom entity Activity entry.

1ActivityEntryMProject

On the Project form, we've added a roll-up field named Total Activities:

roll-up field

And the conditions are properly set:

roll-up field conditions

The Project looks perfectly related to the Activity Entry

Project is associated with Activity Entry

The form shall at least show 1 in the field. Because, there is one Project assigned to one Activity entry.

Total activities

However on the main Project form, the count is always 0 only.

2

2 Answers

1
votes

Rollup fields are calculated from background processes (workflows) so it might take some time to be displayed there. You should see some Mass Calculation jobs there. Also try clicking on the calculator icon you had in the screenshot, that should force the calculation. If it is still 0 after that, there might be something wrong in the rollup field definition.

0
votes

The default The default maximum recurrence setting for Rollup Fields is one hour. https://technet.microsoft.com/en-us/library/dn832162.aspx

If you want to trigger them on demand you use CalculateRollupFieldRequest and CalculateRollupFieldResponse which is a synchronous operation for just the attribute identified in the request.

https://msdn.microsoft.com/en-us/library/dn817863.aspx