Monday, December 23, 2013

Currency Converter using X++ code

In Ms Dynamics Ax 2009
static void CurrencyConverter(Args _args)
{
   CurrencyExchHelper currencyExchangeHelper;
   AmountMst amountMST;
   CurrencyCode transCurrency;
   AmountCur amountCur;
   ;
   amountCur = 5000.00;
   currencyExchangeHelper = CurrencyExchHelper::newExchDate(“KSI”,”USD”,systemDateGet());
   amountMST = currencyExchangeHelper.calculateAmountCurToMst(amountCur ,true);
   info(strFmt(“%1″,amountMST));
}
In Ms Dynamics Ax 2012
static void SR_CEH_Example11(Args _args)
{
CurrencyExchangeHelper currencyExchangeHelper;
CurrencyCode transCurrency = ‘EUR’;
AmountCur amountCur = 500.00;
AmountMst amountMST;

currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet());
amountMST = currencyExchangeHelper.calculateTransactionToAccounting(transCurrency, amountCur ,true);
info(strFmt(‘%1′,amountMST));
}

4 comments:

  1. Trading courses has become a very popular asset class to trade. Trading course you’ll be in a position to make great trades.

    Online Forex Brokers

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. currencyExchangeHelper = CurrencyExchHelper::newExchDate(“KSI”,”USD”,systemDateGet());

    I'm getting an error as This symbol cannot be used in scripts.
    can you suggest me the solution.
    Thank you.

    ReplyDelete