AX 2012: Get Exchange Rates

 

Get Exchange Rates in AX 2012

Parameters are CurrencyCode and TransDate.

 

public ExchRate getExchRateFind(CurrencyCode _currencyCode = ”, TransDate _transDate = systemDateGet())
{
ExchangeRateType ExchangeRateType;
ExchangeRateCurrencyPair ExchangeRateCurrencyPair;
ExchangeRateHelper exchangeRateHelper;
CurrencyExchangeRate exchangeRate1;
CurrencyExchangeRate exchangeRate;
;

exchangeRateHelper = ExchangeRateHelper::newExchangeDate(Ledger::current(), _currencyCode, _transDate);
exchangeRate1 = exchangeRateHelper.getExchangeRate1();
exchangeRate = exchangeRateHelper.displayStoredExchangeRate(exchangeRate1);

return exchangeRate;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s