Convert amount from one currency to another currency using X++
You can use the following X++ code snippet for currency amount conversion.
CurrencyExchangeHelper currencyExchangeHelper;
AmountMst amountMST;
CurrencyCode FromCurrency = 'PKR';
AmountCur amountCur = 5000;
currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet());
amountMST = currencyExchangeHelper.calculateCurrencyToCurrency(fromCurrency, SLDFabCostSheetsCalculation.Currency,amountCur,true);
info(strFmt("%1", amountMST));
Comments