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++

Convert table rows to JSON in X++ D365

How to Create Number Sequence in the D365 X++ ?