Thursday 25 June 2015

I am writing this post to demonstrate to find exchange rate from code for SSRS report in Axapta 2012 R2 , R3.

I am writing this post to demonstrate find exchange rate for SSRS report  in Axapta 2012 R2 , R3.

"CurrencyExchangeHelper" class manages calculations between currencies. with the help of method "calculateCurrencyToCurrency" calculates the amount between the original currency and the resulting currency.

    Let's have a look..

    // find exchange rate
    CurrencyExchangeHelper                  curExchangeRate; ;
    AmountMst                                        calculateCurrency;
    curExchangeRate             = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet());
    calculateCurrency       = currencyExchangeHelper.calculateCurrencyToCurrency("USD" , "SAR" ,1 , true);
    info(strfmt("%1", calculateCurrency));

Now you can get exchange rate USD to SAR , "calculatecurrency" variable provide you the current SAR exchange rate.



Thank you so much!

    

1 comment:

Import General journal from excel in D365 F&O

 Hi Guys, Import General journal from excel in D365 F&O Code:  using System.IO; using OfficeOpenXml; using OfficeOpenXml.ExcelPackage; u...