Multi currency and advanced currency management

From PranavNagrecha/AwesomeSalesforceSkills · View interactive version

Multi currency and advanced currency management is an AI agent skill from the GitHub repository PranavNagrecha/AwesomeSalesforceSkills. Use when designing or reviewing Salesforce multi-currency behavior, especially irreversible activation, `CurrencyIsoCode`, `convertCurrency()`, dated exchange rates, and Advanced Currency Management tradeoffs. Triggers: 'multi currency', 'advanced currency management', 'CurrencyIsoCode', 'dated exch

How to use this skill

Skill file

Multi Currency And Advanced Currency Management

Use this skill when currency is no longer just a formatting concern. Multi-currency and Advanced Currency Management (ACM) change how data is stored, queried, reported, and explained to the business. The design rule: keep every amount next to its currency, and convert only where the consumer asked for a converted value.


Before Starting

Gather this context before working on anything in this domain:


Questions to Ask Before Configuring

| Question | Why it matters | What a good answer adds | What proper configuration adds over just doing it |

|---|---|---|---|

| "Have the sponsors signed off that turning on multiple currencies is permanent?" | The Metadata API says enableMultiCurrency "can't be set to false" after it is set to true | A recorded decision and a full sandbox rehearsal before production | No surprise one-way change to every record's data model |

| "Which amounts need historical rates, and on which objects?" | The SOQL guide says ACM dated rates apply to opportunities, opportunity line items, and opportunity history; other currency fields use the static rate | A list of reports that will change meaning under ACM, and those that will not | Finance knows which numbers are dated and which are not |

| "Who loads exchange rates, how often, and through which API?" | CurrencyType and DatedConversionRate do not support Apex DML; rates come in through the API or Setup | A named owner and an API-only job for rate loads | Rates that stay current without a manual Setup task |

| "Do integrations send the ISO code with every amount?" | CurrencyIsoCode exists only in multi-currency orgs and the stored amount is in that currency | A payload contract of amount plus ISO code | Downstream systems stop guessing the currency |

| "Do any queries total money with GROUP BY?" | Aggregates with GROUP BY or HAVING return the org's default currency, and convertCurrency() cannot wrap them | Reports or code that label totals as corporate currency | Totals that match what users expect to see |

| "Does code need to run in single-currency orgs too?" | Static SOQL naming CurrencyIsoCode or CurrencyType assumes multi-currency | A UserInfo.isMultiCurrencyOrganization() guard and dynamic SOQL | Packages and shared code that install in any org |

What a proper configuration adds over just ticking the box: the irreversible switch is rehearsed, every amount travels with its ISO code, the team knows exactly which reports use dated rates, and rate loads are an owned, automated job.


Core Concepts

Enabling multi-currency is one-way

CurrencySettings (Metadata API, Currency.settings) holds enableMultiCurrency, enableCurrencyEffectiveDates, enableCurrencySymbolWithMultiCurrency, and isParenCurrencyConvDisabled. After enableMultiCurrency is true it cannot be set to false. enableCurrencyEffectiveDates (ACM) requires enableMultiCurrency.

Where currency lives

| Object or field | What it holds | Writable how |

|---|---|---|

| CurrencyIsoCode on records | The record's currency; available only in multi-currency orgs | Normal DML |

| CurrencyType | One row per currency: IsoCode, ConversionRate against the corporate currency, DecimalPlaces, IsActive, IsCorporate | API create() and update(); no Apex DML; cannot be deleted |

| DatedConversionRate | Rate per currency per date range: IsoCode, ConversionRate, StartDate, read-only NextStartDate | API update() and delete() listed in the Object Reference; no Apex DML; exists only with ACM |

When updating a CurrencyType record, send every field. The Object Reference warns that a missing IsActive defaults to false and can deactivate an active currency.

`convertCurrency()` rules

ACM scope

ACM adds a time dimension only where the SOQL guide says dated rates apply. Everything else keeps converting at the static CurrencyType rate. UNVERIFIED (2026-10-03): the help-only statements about ACM and roll-up summary fields on Account; help.salesforce.com does not return article text to a fetch, so test roll-ups in a sandbox before enabling ACM.


Common Patterns

Currency-aware query

Query CurrencyIsoCode with every amount you expose. Use convertCurrency() only when the requirement is the viewer's currency. Example with a test class in references/examples.md.

Code that runs in any org

Guard with UserInfo.isMultiCurrencyOrganization() and build the field list dynamically. UserInfo.getDefaultCurrency() returns the user's currency in a multi-currency org and the org currency in a single-currency org.

Rate loads from finance

An API-only integration user updates CurrencyType (static rates) or DatedConversionRate (ACM rates) on a schedule. Apex cannot do this with DML.

Integration DTO with currency context

Send amount and ISO code together. Never send a bare decimal.


Decision Guidance

| Situation | Recommended Approach | Reason |

|---|---|---|

| Org needs multiple transactional currencies | Multi-currency, after a rehearsal | One-way switch |

| Historical opportunity reporting needs period rates | ACM | Dated rates apply to opportunity, line item, and history amounts |

| Historical rates needed on a custom object | Store the rate or converted amount on the record | Dated rates do not apply outside the opportunity family |

| Apex exposes money values externally | Include CurrencyIsoCode with the amount | Prevents silent interpretation errors |

| Filter by amount across currencies | ISO-prefixed literal in WHERE | convertCurrency() is not allowed in WHERE |

| Total money in SOQL | Label the result as corporate currency | Aggregates return the org default currency |

| Change exchange rates from Apex | Do not; use the API from an integration | No DML on CurrencyType or DatedConversionRate |


Recommended Workflow

  1. Inventory currency consumers. List reports, forecasts, roll-ups, Apex, integrations, and analytics that read money.
  2. Decide the switch. If multi-currency is not enabled, run it in a full sandbox, review the inventory, and record sign-off that it is permanent.
  3. Scope ACM. Mark which consumers use opportunity-family amounts (dated) and which use static rates.
  4. Fix the code. Add CurrencyIsoCode next to amounts, remove convertCurrency() from WHERE and ORDER BY, guard shared code with isMultiCurrencyOrganization(), and run python3 scripts/check_multi_currency_and_advanced_currency_management.py --manifest-dir force-app.
  5. Automate rate loads. Build the API job that updates CurrencyType or DatedConversionRate, sending all fields on CurrencyType updates.
  6. Deploy settings and verify. Deploy Currency.settings from references/metadata-examples.md and check converted amounts in a report and in SOQL for a known record.

Review Checklist


Salesforce-Specific Gotchas

See references/gotchas.md. The two that cause the most rework: a CurrencyType update that omits IsActive deactivates the currency, and aggregates return the corporate currency no matter who runs the query.


Output Artifacts

| Artifact | Description |

|---|---|

| Currency design review | Findings on activation, conversion, reporting, and Apex handling |

| Query guidance | Stored-currency versus converted-currency retrieval per consumer |

| ACM decision | Which amounts get dated rates and which do not |

| Currency.settings and rate-load job | Deployable settings and the API job for rates |


Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.