How do I resolve "TaxService.GetTaxRequest.sexchangeRateEff..." error message in Microsoft Dynamics NAV?
Overview
When committing an invoice, I get the following error in NAV:
"A call to
Avalara.Ava.Tax.Adapter.TaxService.GetTaxRequest.sexchangeRateEffDate failed with this message: Index and length must refer to a location within the string.
Parameter name: length"
Environment
Microsoft Dynamics NAV
Resolution
- This error is caused by an outdated rate exchange file in Dynamics NAV.
- To resolve this error you must update the exchange rates in NAV.
- Avalara Technical support cannot help with this. If you need assistance, please contact the Dynamics NAV Technical Support line
- Although there are no requirements for when, or how often, you should enter new exchange rates.
- Before you can update the exchange rates, you must set up currency codes and currency exchange rates.
- To Update Exchange Rates in NAV
- In the Search box, enter Currencies, and then choose the related link.
- In the Currencies window, select the line with the currency code you want to update
- On the Actions tab, choose Exch.Rates.
- In the Currency Exchange Rates window that appears, fill in the fields on the next blank line.
- For more information about a specific field, select field, and then press F1.
- Close the windows
- Run the Adjust Exchange Rates batch job to adjust the exchange rates of posted customer, vendor, and bank account entries.
- The batch job also updates the additional reporting currency amounts on the general ledger entries.
- If the steps above do not resolve the issue and you are on NAV 2013 or earlier, please upgrade to NAV 2015 RTM 8.00.37874.08.00 released in April 2016.
- If you are unable to update, please try implementing the fix below:
-
Analysis
Found issue in code unit – “14073301 - AVA Tax Engine” – wrong selection of variable in else part of if condition.Solution
Changes done on function: fnGetTaxHdrV3 of code unit: 14073301 - AVA Tax Engine
Code difference over fix and original code is as below
Old Code : IF DATE2DMY(ExDate,2) < 10 THEN sExDateMM := '0'+FORMAT(DATE2DMY(ExDate,2)) ELSE sExDateDD := FORMAT(DATE2DMY(ExDate,2));
New code : IF DATE2DMY(ExDate,2) < 10 THEN sExDateMM := '0'+FORMAT(DATE2DMY(ExDate,2)) ELSE sExDateMM := FORMAT(DATE2DMY(ExDate,2));