web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • jhowe Profile Picture
    1,205 on at
    RE: sales invoice currency conversion

    @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.

  • Suggested answer
    Satish Panwar Profile Picture
    14,669 Moderator on at
    RE: sales invoice currency conversion

    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?

  • Verified answer
    Evaldas Profile Picture
    1,800 on at
    RE: sales invoice currency conversion

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

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

    What else could you do? :)

  • jhowe Profile Picture
    1,205 on at
    RE: sales invoice currency conversion

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

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: sales invoice currency conversion

    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

  • Suggested answer
    Satish Panwar Profile Picture
    14,669 Moderator on at
    RE: sales invoice currency conversion

    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.

  • Evaldas Profile Picture
    1,800 on at
    RE: sales invoice currency conversion

    Make sure you have exchange rate on the InvoiceDate.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 878 User Group Leader

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 496 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans