How to Convert Transaction Currency Amount to Company Ledger Currency in D365FO
Introduction
Currency conversion is a crucial aspect of financial management, especially for businesses operating in multiple countries. In Dynamics 365 Finance and Operations (D365FO), converting transaction currency amounts to the company ledger currency ensures accurate financial reporting and compliance. Let's dive into how you can achieve this seamlessly in D365FO.
In Many situations an organization must do transaction with foreign currencies. Every ERP system has the option for converting Transaction Currency Amount to Company Ledger Currency.
Understanding Currency Conversion
Definition and Purpose
Currency conversion involves translating amounts from one currency to another using exchange rates. This is essential for businesses to consolidate their financial statements, manage risks, and comply with local regulations.
Key Terms and Concepts
Base Currency: The primary currency used by a company for its financial reports. The default currency, also known as the base currency, is set during the initial setup of the ledger.
Transaction Currency: The currency in which a transaction is initially recorded.
Exchange Rate: The rate at which one currency can be exchanged for another.
Setting Up Currencies in D365FO
Configuring Base and Transaction Currencies
In D365FO, you can set up both the base currency (company ledger currency) and transaction currencies. Navigate to the General ledger > Ledger setup > Ledger and specify the base currency.
Convert Transaction Currency to Company Ledger Currency using X++ Code
class ConvertCurrencyExample
{
public static void main(Args _args)
{
CurrencyExchangeHelper currencyExchangeHelper;
CurrencyCode transCurrencyCode = 'INR';
AmountCur amountCur = 2500.00;
AmountMst amountMST;
currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet());
amountMST = currencyExchangeHelper.calculateTransactionToAccounting(transCurrencyCode, amountCur ,true);
info(strFmt('Accounting Currency Amount = %1',amountMST));
}
}
This line declares a variable currencyExchangeHelper of type CurrencyExchangeHelper. This helper class is used to manage currency exchange operations in Dynamics 365 Finance and Operations (D365FO).
Set Transaction Currency Code int 'INR', which stands for Indian Rupees. This variable specifies the currency of the transaction that needs to be converted.
Then set Transaction Amount amountCur variable is set to 2500.00. This represents the amount in the transaction currency (INR) that needs to be converted to the accounting currency.
Variable amountMST is declared to store the converted amount in the accounting currency (also known as the ledger currency).
Next line initializes the currencyExchangeHelper object. The newExchangeDate method takes two parameters:
- Ledger::current(): This gets the current ledger, which is used to determine the base accounting currency.
- systemDateGet(): This gets the current system date, which is used to fetch the relevant exchange rate.
- transCurrencyCode: The currency code of the transaction (INR).
- amountCur: The amount in the transaction currency (2500.00).
- true: This parameter typically specifies whether to include certain adjustments or not (it can depend on the specific implementation in D365FO). The method returns the converted amount in the accounting currency, which is then assigned to amountMST.
The method returns the converted amount in the accounting currency, which is then assigned to amountMST.
Finally, the info function is used to display a message in the Infolog. The strFmt function formats the string by replacing %1 with the value of amountMST. This displays the converted amount in the accounting currency.
In the browser window you can see the output of the above code,
Conclusion
Converting transaction currency amounts to the company ledger currency in D365FO is vital for accurate financial reporting and compliance. By understanding the process, setting up the necessary configurations, and following best practices, businesses can ensure smooth and error-free currency conversions. D365FO can handle multiple exchange rates for different transaction types and periods. Best practices include maintaining accurate exchange rates, conducting regular audits, and using automated tools for updating rates.
Published on:
Learn moreRelated posts
Creating A Currency Conversion Table In Power BI
In this tutorial, we’re going to learn how to create a currency conversion table for Sales in Power BI using DAX measures. You may watch the f...
Currency Rates In Power BI: Handling Missing Data
Learn how to handle missing data in a currency-rates table by using DAX and power query in Power BI with this helpful tutorial. Whether you're...
Dataverse: Create an API to update Base Currency
This time, I’ve got a request from Trung Dũng Nguyễn where he wants to update the base currency based on the updated Currency inputted i...
Transform a Regular Number into a Currency in Canvas App
In this blogpost, we will learn to convert & transform a regular number into a currency in Canvas App. Before we begin, ensure you subscri...
Microsoft Syntex: Operators on custom number, currency and date columns, and inclusions and exclusions within text-based fields
In a recent update to Microsoft Syntex, users gained the ability to query custom number, currency, and date columns using operators. Additiona...
How to Auto-Update Currency Exchange Rates in Dynamics 365/Dataverse using Power Automate
This video tutorial teaches you how to automatically update currency exchange rates in Dynamics 365/Dataverse using Power Automate. With the c...
Change the default currency to local currency in dynamics 365
Dynamics 365 or Dataverse supports multiple currency. You can choose a base currency while creating an environment. For example USD. But if yo...
Power Automate: How to convert a string to formatted currency?
Not all numbers (or strings that are numbers) are the same so we should not treat them as such. Some could be a simple number … The pos...
BG#1 UCI Currency Symbol Modification
WHEN? When the symbol of a currency is modified, for example from € to M€. NB: Changing the symbol of a currency field is done through:...
Rollup Field Error – Record currency is required to calculate rollup field of type currency
One of my recent MS CRM development, I have come across with rollup field error i.e. Record currency is required to calculate rollup field of ...