public static CurrencyExchangeRate currencyConversion(CurrencyCode fromCurrencyCode, CurrencyCode toCurrencyCode) { ExchangeRateCurrencyPair exchangeRateCurrencyPair,exchangeRateCurrencyPair2; ExchangeRateDisplayFactor exchangeRateDisplayFactor; ExchangeRate exchangeRate; date validFromDate = dateNull(); date validToDate = dateMax(); CurrencyCode _fromCurrencyCode = fromCurrencyCode; CurrencyCode _toCurrencyCode = toCurrencyCode; ExchangeRateTypeRecId _exchangeRateType2; boolean _getReciprocalIfPrimaryNotFound = true; CurrencyExchangeRate exchRateValue; _exchangeRateType2 = ExchangeRateType::findByName(Exchange Rate Type).RecId; select firstonly ExchangeRateDisplayFactor from exchangeRateCurrencyPair where exchangeRateCurrencyPair.FromCurrencyCode == _fromCurrencyCode && exchangeRateCurrencyPair.ToCurrencyCode == _toCurrencyCode && exchangeRateCurrencyPair.ExchangeRateType == _exchangeRateType2; if(exchangeRateCurrencyPair.ExchangeRateDisplayFactor) { select firstonly validtimestate(validFromDate, validToDate) exchangeRate where exchangeRate.ExchangeRateCurrencyPair == exchangeRateCurrencyPair.RecId; exchRateValue = ExchangeRateHelper::displayStoredExchangeRate_Static( exchangeRate.ExchangeRate, exchangeRateCurrencyPair.ExchangeRateDisplayFactor); } else { select firstonly ExchangeRateDisplayFactor from exchangeRateCurrencyPair2 where exchangeRateCurrencyPair2.FromCurrencyCode == _toCurrencyCode && exchangeRateCurrencyPair2.ToCurrencyCode == _fromCurrencyCode && exchangeRateCurrencyPair2.ExchangeRateType == _exchangeRateType2; if(exchangeRateCurrencyPair2.exchangeRateDisplayFactor) { select firstonly validtimestate(validFromDate, validToDate) exchangeRate where exchangeRate.ExchangeRateCurrencyPair == exchangeRateCurrencyPair2.RecId; exchRateValue = exchangeRateCurrencyPair2.ExchangeRateDisplayFactor / ExchangeRateHelper::displayStoredExchangeRate_Static( exchangeRate.ExchangeRate, exchangeRateCurrencyPair2.ExchangeRateDisplayFactor); } } return exchRateValue; }
Wednesday, 4 March 2015
Getting exchange rate value in ax 2012
Subscribe to:
Post Comments (Atom)
Best Practices for Troubleshooting Application Issues in D365 and Power Platform
When facing application issues, it’s important to systematically troubleshoot before reaching out for support. Follow these steps to ensure...

-
Microsoft Dynamics Ax Macros In MorphX macros are not commonly used. A few places make use of macros such as keeping track of the li...
-
Introduction The query statement in X++ is a primary method of retrieving and manipulating data in Microsoft Dynamics AX 2012. A query can...
Wow, Excellent post. This article is really very interesting and effective. I think its must be helpful for us. Thanks for sharing your informative.
ReplyDeleteearn money online | outsourcing | high traffic USA forum list | free seo tools | get money for sharing youtube videos | minecraft | clash of clans
Free porn sex videos & pussy movies | ultimate xxx porn | sex and pussy tube | free sex movies | Hard Fuck Girls | Dolls Porn | Free porn HD | Hot Teens HD | Xxx Porn Tube | Sex Tube Fuck | Hard Anal Porn | Wife Sex | Spy Sex Tube | Mature Porn Videos | New Sex Tube | Top Sex Clips | Video Sex Party | Mature Fucking | Fat Fuck Movies | Big Tits Mature | Best Classic Xxx | Sex Porn Asian | Teen Sex Reality