web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

conversion of currency

(0) ShareShare
ReportReport
Posted on by 213

 hello experts,

i have wriiten the below code for converting  given currency into  default currency . i am geeting wrong value, plse hlp me out.

[
SysEntryPointAttribute(false)
]

public void processReport()
{
SintoPCurrencyContractClass Contract;
Contract= this.parmDataContract();
accountNum=contract.parmAccountNum();


while select * from vendTrans

where

vendTrans.AccountNum ==accountNum


{
SintoPCuurencyTmp.AccountNum = vendTrans.AccountNum;
SintoPCuurencyTmp.Voucher = vendTrans.Voucher;
SintoPCuurencyTmp.AmountCur=vendTrans.AmountCur;
SintoPCuurencyTmp.Invoice=vendTrans.Invoice;
SintoPCuurencyTmp.CurrencyCode=vendTrans.CurrencyCode;
SintoPCuurencyTmp.IndAmountCur = any2real (Currency::amountCur2MST (vendTrans.AmountCur,"jpy"));


currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet());
SintoPCuurencyTmp.IndAmountCur = currencyExchangeHelper.calculateCurrencyToCurrency('INR', vendTrans.CurrencyCode,vendTrans.AmountCur,true);


// SintoPCuurencyTmp.IndAmountCur=vendTrans.AmountMST;
// SintoPCuurencyTmp.IndCurrencyCode=vendTrans.CurrencyCode;
SintoPCuurencyTmp.VendName=vendTrans.vendTableName();


SintoPCuurencyTmp.insert();
}

}

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,392 Most Valuable Professional on at

    Do you realize that you assign IndAmountCur twice? Because the second assignment overwrites the first one, it's like if the first one wasn't ever there. If you don't want to use the first one, delete it. If you want, delete the second assignment.

    If you still have a problem, come back and explain which calculation are you using.

  • Verified answer
    Crispin John Augustine Profile Picture
    37,081 on at

    you have 2 lines with currency conversion.

    "...Currency::amountCur2MST (vendTrans.AmountCur,"jpy")..."

    "...currencyExchangeHelper.calculateCurrencyToCurrency('INR', vendTrans.CurrencyCode,vendTrans.AmountCur,true)..."

    Where exactly do you get a wrong value?

  • Verified answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi pradeep,

    Have you checked the standard accounting currency conversion functionality that is available in the periodic section of the GL module?

    What do you miss from this standard function that some coding is needed?

    Best regards,

    Ludwig

  • Verified answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    This is the line of code that will set your IndAmountCur field:

    SintoPCuurencyTmp.IndAmountCur = currencyExchangeHelper.calculateCurrencyToCurrency('INR', vendTrans.CurrencyCode,vendTrans.AmountCur,true);

    Could you share us

    - what values you pass to all these parameters

    - what is the actual return value

    - what is the expected return value?

    Thanks!

  • pradeep M B Profile Picture
    213 on at

    thank you for response,

    i want  to convert any amount(us,jpy..etc) to indian currency

    so  can u hlp me out.

    regards,

    pradeep

  • Verified answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    Yes, we are happy to help you. Let's start by getting the relevant facts from your side - so could you please answer my previous question?

  • pradeep M B Profile Picture
    213 on at

    Thank you sir,

    Now currency amount is working fine.

    regards,

    Pradeep

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 657

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 615 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 356

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans