How to Get Sales order exchange rate in ax 2012

What is an 'Exchange Rate'?

The price of a nation’s currency in terms of another currency. An exchange rate thus has two components, the domestic currency and a foreign currency, and can be quoted either directly or indirectly. In a direct quotation, the price of a unit of foreign currency is expressed in terms of the domestic currency. In an indirect quotation, the price of a unit of domestic currency is expressed in terms of the foreign currency. An exchange rate that does not have the domestic currency as one of the two currency components is known as a cross currency, or cross rate. Also known as a currency quotation, the foreign exchange rate or forex rate.

static void GetExcRate(Args _args)
{
    container  displayFields;
    Common     orderTable;
    real        ExcRate;
    SalesTable _ObjSalesTable;

    select * from _ObjSalesTable where _ObjSalesTable.SalesId == "SalesOrderId";

    orderTable = _ObjSalesTable;
    displayFields = SalesTotals::displayFieldsServer(orderTable, 0, _ObjSalesTable.CurrencyCode);
    ExcRate = conpeek(displayFields, TradeTotals::posExchRate());
    info(strFmt("%1",ExcRate/100));
}

Related Posts

Previous
Next Post »

Thanks for comments.....