D365 – Currency Fields

Introduction

In this article:

  1. The base currency is US Dollar (USD)
  2. Two entities were created for testing: Invoice and Invoice Detail, with a one-to-many relationship between them

Basic Concepts

Currency is a field type in Dynamics CRM used to store monetary values. When a currency field is created in an entity, the system automatically generates four related fields in the background.

For example, when a currency field named Amount is added to the Invoice Detail entity, the following fields are created:

Amount currency field added to Invoice Detail entity

Additionally, two more fields are involved:

Creating New Currencies

Go to Power Platform Admin Center → Select Environment → Enter Settings → Choose Currencies.

Create currency - 01

On the pop-up page, add a new currency:

Create currency - 02

For this experiment, two new currencies were added: RMB and JPY.

Currency Name Currency Code Symbol Exchange Rate Precision
US Dollar USD $ 1.0000 2
RMB CNY 7.2500 2
JPY JPY JPY¥ 147.6300 2

Notes

  1. When the exchange rate is updated, Dynamics CRM does not recalculate existing currency fields.
  2. Exchange rates are defined by the system administrator.

Creating Test Data

No. Currency Amount Amount(Base) Exchange Rate
SASD-00001260 JPY JPY¥ 1,000.00 $6.77 147.6300000000
SASD-00001259 US Dollar $1,000.00 $1,000.00 1.0000000000
SASD-00001258 RMB ¥ 1,000.00 $137.93 7.2500000000

Test data created

As shown, if the selected currency is not the base currency, Amount(Base) is automatically calculated based on Amount and Currency.

Adding Rollup for Currency

What happens when a rollup field is added to a currency? Here, a currency field Example - Total Amount was created in the Invoice entity:

New rollup currency field

Rollup rule configuration:

Rollup rule

Rollup result:

The field Example - Total Amount calculates based on the related currency values. The process is: Currency → Exchange Rate → Example - Total Amount(Base) × Exchange Rate.

Rollup result


Notes

  1. In CRM, rollup fields are periodically updated. Update frequency can be configured in system jobs, but the minimum interval is once per hour.
  2. Rollup calculation can also be triggered manually. By clicking the small calculator icon beside the rollup field, a Recalculate button appears:

Recalculate

User Default Currency

Although the base currency is set to USD, each user in CRM can configure their default currency. When creating a new Invoice record, the Currency field will default to the user’s chosen currency.

User default currency - 01

For example, if user test06 sets the default currency to JPY and creates a new Invoice record:

User default currency - 02

The currency field on the form is automatically set to JPY:

User default currency - 03

References

  1. Create and edit Dataverse columns using Power Apps solution explorer (CN)
  2. Types of fields – Using currency columns (EN)

Copyright Notice

Author: Donghai

Link: https://gdhblog.com/posts/d365/currency-fields/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Comments

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut