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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

sales invoice currency conversion

(0) ShareShare
ReportReport
Posted on by 1,205

Hi all,

I have extended the sales invoice in Dynamics 365 Finance and Operations (or Finance whatever it's called now).  I have a field which simply takes the tax amount in whichever currency it's in, and converts it into Euros which works fine.  One of the users has now requested that instead of looking up the conversion amount by current date, they want it done by the date on the invoice (invoice date).    

So my code currently is 

salesInvoiceTmp.SumVATEuro = CurrencyExchangeHelper::curAmount2CurAmount(salesInvoiceTmp.SumTax, salesInvoiceTmp.CustInvoiceJourCurrencyCode, "EUR" , DateTimeUtil::getToday(DateTimeUtil::getUserPreferredTimeZone()));

I changed it to 

salesInvoiceTmp.SumVATEuro = CurrencyExchangeHelper::curAmount2CurAmount(salesInvoiceTmp.SumTax, salesInvoiceTmp.CustInvoiceJourCurrencyCode, "EUR" , custInvoiceJour.InvoiceDate);

However then i get the error 

An exchange rate cannot be found for exchange rate type Default between currencies GBP and EUR on exchange date .

How to avoid this error?  Apologies i'm not highly experienced in x development.  

I have the same question (0)
  • Evaldas Profile Picture
    1,800 on at

    Make sure you have exchange rate on the InvoiceDate.

  • Suggested answer
    Satish Panwar Profile Picture
    14,671 Moderator on at

    Hi Jhowe,

    Typically exchange rates are maintained monthly or weekly. They are setup at General Ledger > Currencies > Currency exchange rates. Set one up between the two currencies and then you should be all set.

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi jhowe,

    Why is this adjustment required?

    In the sales order form there is a totals button/form available.

    In this form users can switch between the different currencies and previews the values.

    I cannot see the necessity for making this system modification.

    Would be great if you could elaborate.

    Many thanks,

    Ludwig

  • jhowe Profile Picture
    1,205 on at

    Hi, @Evaldas yes that's obvious but if there is no date, how do i handle it that's my question... thanks.

  • Verified answer
    Evaldas Profile Picture
    1,800 on at

    Test the date and set the alternative if that is required.

    CustInvoiceJour.InvoiceDate ? CustInvoiceJour.InvoiceDate : DateTimeUtil::getToday()

    What else could you do? :)

  • Suggested answer
    Satish Panwar Profile Picture
    14,671 Moderator on at

    Why would there be invoice with no date? The problem is exchange rate and until you verify that the issue will remain. Did you verify exchange rate?

  • jhowe Profile Picture
    1,205 on at

    @Evaldas This is the kind of thing i was looking for I actually ended up using an if statement.  The reason why I was getting the error i believe is because although i was returning the date, there was another query further down that was affecting this and causing issues.  Agree with other posts there should always be a conversion for every invoice date so this should not be needed. @Ludwig this is the invoice output i'm talking about (ssrs report) thanks all for the help.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans