Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Roll up field for currency datatype fields is not working for custom entities

Following is the exact scenario in my Dynamics CRM instance.

I have created a custom entity (say, Order), which is having a lookup field (say, Item). The lookup field is pointing to another entity which is having a currency field (say, Amount). I have created a roll-up field (say, Total Amount) in Order entity, and set it to calculate sum of Amount for all items for the order. Once created, I have placed the control on main form of the entity.

When I try to check the value of rollup field (by clicking Refresh icon of the roll-up field), it gives me following error:

Record currency is required to calculate rollup field of type currency. Provide a currency and try again.

I tried similar for Account and Opportunities entities, and the new rollup field works perfectly there.

Any idea why it doesn't work for the custom entity? Do I need to do anything extra at entity or form level?

like image 774
Nirman Avatar asked Mar 13 '23 23:03

Nirman


1 Answers

You will receive the error Provide a currency and try again for all records created before you created the rollup field, since they will not contain valid data in the Currency (TransactionCurrencyId) field.

Any records created after you added the field should automatically have the currency field set, and the rollup field should thus work correctly.

Since Account and Opportunity both contain currency fields out of the box, all records of these types will have the Currency field set correctly. It is thus not an issue to later add a currency rollup field.

You will need to set the Currency field on the existing (custom) Order records for the rollups to work correctly. This can e.g. be done by adding the Currency field to the form, and selecting the right currency for each Order (either manually, using bulk edit, or by creating a workflow).

like image 138
Henrik H Avatar answered Apr 05 '23 23:04

Henrik H