Recently I was working with a client, MD, and we wanted to set up a rollup that took the currency values from some custom product lines and rolled them up to total on a custom entity. Sure, seems straight forward. And it is right in the rollup field sweet spot. We created the Total field, set the data type to currency and field type to rollup. Clicked the Edit button and added the related entity and aggregation without issue. Since I was working with an administrator I took a few minutes to discuss the additional fields created by a rollup (status, last run). Then I warned don’t add the status and last run to a form because if you try to move the form in a solution you will get an error. Finally we added the Rollup to the form, saved and published. The usual.


Record Currency is Required


"Let’s see this baby work!" I exclaimed, rubbing my hands together in anticipation. We navigated to a record, opened the parent record we knew had child related record where we had previously created line items for the rollup to have something to calculate and clicked the recycle arrows to refresh the new Total rollup field. BOOM! The reviled red circle white X and the title "Currency Field Missing. Record currency is required to calculate rollup field of type currency. Provide a currency and try again" dialog box popped up.


Currency Field Missing



We poked around, checked to make sure there was a default currency in the system, there was. Then we looked in the original entity we were moving from to see if there was a currency field, there was. Then we did some research and got here.




Apparently when a field with the data type of currency is created on an entity for the first time the currency lookup field is automatically created. This is a separate field called currency that looks up to the currency entity managed in Settings->Business Management. It's schema name is  transactioncurrencyid. This is what the system uses to determine how to calculate the price of things especially important if an organization is using multiple currencies. 


So we see this currency field in the field list but at the time we were not sure if it had been created when we created the rollup or if it had always been there. Regardless it is obviously not respecting the rollup currency field so we added it to the form.


For good measure we refreshed the form and the browser, a lot. Published the form and entity, a lot. Deleted the lines and manually refreshed the total field, eventually getting 0. Once we got 0 and no error, MD re-added the lines and manually clicking the recycle button, gave us the result we were looking for, the total rolled up from the lines. Wow, all that just because the currency field was not on the form.


Hope this little adventure helps you save some time.