ICurrencyCache

The ICurrencyCache service provides cached access to the org's transactioncurrency set plus the organization's base currency. Currencies are loaded as a single snapshot on first access and refreshed on a coarse sliding window — admins rarely add new currencies, so the cache trades a tiny memory footprint for eliminating per-record currency lookups on the hot record-retrieve path.

Automatic Population on Records

You usually don't need to touch ICurrencyCache directly. Whenever a record's fetch includes at least one money column, the server auto-projects transactioncurrencyid and attaches the resolved currency to the record's Currency property. MoneyEdit consumes that to render the correct symbol in its start adornment.

React
Blazor

Direct Access

For custom server-side code that needs to look up a currency by id, enumerate every currency in the org (a currency picker, an exchange-rate display), or resolve the base currency, inject ICurrencyCache:

Tip

ICurrencyCache is server-side only. Browser-side code that needs the row's currency reads TableRecord.Currency (Blazor) / record.currency (React) directly — populated automatically when the record carries a money column.

ICurrencyCache Interface

Methods

Name
Parameters
Type
Description
GetGuid id
Currency?
Returns the currency with the given transactioncurrencyid, or null when no matching record exists in Dataverse.
GetAllIReadOnlyDictionary<Guid, Currency>
Returns every currency configured in the org, keyed by id. Loaded as a single snapshot — callers iterating the dictionary won't see partial updates if the cache refreshes mid-enumeration.
GetAllAsyncCancellationToken token
Task<IReadOnlyDictionary<Guid, Currency>>
Asynchronously returns every currency configured in the org, keyed by id.
GetAsyncGuid id
CancellationToken token
Task<Currency>
Asynchronously returns the currency with the given transactioncurrencyid, or null when no matching record exists.
GetBaseCurrencyCurrency?
The org's base currency, resolved from organization.basecurrencyid. Used as the fallback for records whose transactioncurrencyid is null — typical for tables that don't participate in multi-currency at all. Returns null if the organization record can't be resolved (which would also indicate a deeper Dataverse connectivity problem).
GetBaseCurrencyAsyncCancellationToken token
Task<Currency>
Asynchronously returns the org's base currency.
Name: Get
Parameters: Guid id
Type: Currency?
Description: Returns the currency with the given transactioncurrencyid, or null when no matching record exists in Dataverse.
Name: GetAll
Type: IReadOnlyDictionary<Guid, Currency>
Description: Returns every currency configured in the org, keyed by id. Loaded as a single snapshot — callers iterating the dictionary won't see partial updates if the cache refreshes mid-enumeration.
Name: GetAllAsync
Parameters: CancellationToken token
Type: Task<IReadOnlyDictionary<Guid, Currency>>
Description: Asynchronously returns every currency configured in the org, keyed by id.
Name: GetAsync
Parameters: Guid id
CancellationToken token
Type: Task<Currency>
Description: Asynchronously returns the currency with the given transactioncurrencyid, or null when no matching record exists.
Name: GetBaseCurrency
Type: Currency?
Description: The org's base currency, resolved from organization.basecurrencyid. Used as the fallback for records whose transactioncurrencyid is null — typical for tables that don't participate in multi-currency at all. Returns null if the organization record can't be resolved (which would also indicate a deeper Dataverse connectivity problem).
Name: GetBaseCurrencyAsync
Parameters: CancellationToken token
Type: Task<Currency>
Description: Asynchronously returns the org's base currency.

Currency Class

Properties

Name
Type
Default
Description
ExchangeRatedecimal
1
Exchange rate against the org's base currency, from exchangerate. 1.0 for the base currency itself. Surfaced primarily for diagnostic / advanced display scenarios — editors don't perform conversion locally.
IsoCodestring
The ISO 4217 three-letter code (e.g. USD, EUR, JPY). Read from isocurrencycode. Useful for ARIA labels and culture-aware formatting fallbacks.
Namestring
The localized currency name from currencyname (e.g. US Dollar). Used in pickers, tooltips, and accessibility text.
Precisionint
2
Decimal places to display, sourced from currencyprecision. Falls back to 2 when Dataverse leaves the field null. Independent of MoneyMetadata.Precision, which is the column-level precision; this is the currency-level default.
Symbolstring
The display symbol Dataverse stores in currencysymbol — up to 5 characters, typically a single Unicode glyph ($, , £, ¥) but occasionally a short string for currencies that lack a single-glyph form (Fr, kr, R$) or org-specific custom values. Rendered verbatim in the editor — Unicode + font fallback covers every glyph; no SVG sidecar.
Name: ExchangeRate
Type: decimal
Default: 1
Description: Exchange rate against the org's base currency, from exchangerate. 1.0 for the base currency itself. Surfaced primarily for diagnostic / advanced display scenarios — editors don't perform conversion locally.
Name: IsoCode
Type: string
Description: The ISO 4217 three-letter code (e.g. USD, EUR, JPY). Read from isocurrencycode. Useful for ARIA labels and culture-aware formatting fallbacks.
Name: Name
Type: string
Description: The localized currency name from currencyname (e.g. US Dollar). Used in pickers, tooltips, and accessibility text.
Name: Precision
Type: int
Default: 2
Description: Decimal places to display, sourced from currencyprecision. Falls back to 2 when Dataverse leaves the field null. Independent of MoneyMetadata.Precision, which is the column-level precision; this is the currency-level default.
Name: Symbol
Type: string
Description: The display symbol Dataverse stores in currencysymbol — up to 5 characters, typically a single Unicode glyph ($, , £, ¥) but occasionally a short string for currencies that lack a single-glyph form (Fr, kr, R$) or org-specific custom values. Rendered verbatim in the editor — Unicode + font fallback covers every glyph; no SVG sidecar.