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

Popular posts from this blog

Create custom workflow in D365 X++

How to Create Extended Data Types (EDTs) in Finance and Operations of Dynamics 365 -- F&O Customization Part 2