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.