Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Sunday, January 12, 2014

Code for exchange rates in Dynamic AX 2012

Hi,

currency::find(CurrencyCode).findExchRate(today()); in Dynamic ax 2009 following code is for Dynamic AX 2012

    static ExchRate exchRateFind(CurrencyCode _currencyCode = '')
{
    ExchangeRateType    ExchangeRateType;
   // ExchangeRate        ExchangeRate;
    ExchangeRateCurrencyPair    ExchangeRateCurrencyPair;
    ExchRate    ret;
    ExchangeRateHelper exchangeRateHelper;
    TransDate transactiondate;
    CurrencyExchangeRate exchangeRate1;
    CurrencyExchangeRate exchangeRate;
    ;
    exchangeRateHelper = ExchangeRateHelper::newExchangeDate(Ledger::current(), _currencyCode, systemDateGet());
    exchangeRate1 = exchangeRateHelper.getExchangeRate1();
    exchangeRate = exchangeRateHelper.displayStoredExchangeRate(exchangeRate1);//Ledger::find(Ledger::current()).DefaultExchangeRateType
    return exchangeRate;
}

Regards,

1 comment:

How to invoke and iterate List as Contract methods in AX 2012/ D365

Hi, Public void performContractIterate(ClassContainsListAsContract    _ListCarryClass) { List contractFieldList = new List(Types::Class); ...