Unified Operations & Dynamics AX Forum

Expand all | Collapse all

"A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

  • 1.  "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    TOP CONTRIBUTOR
    Posted Dec 27, 2018 07:45 PM
    ​An AP user is getting this error msg that we haven't seen before when trying to post an invoice:

         Error msg when posting AP invoice

    Any suggestions for resolving this error?

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------
    AXUG Summit - Post


  • 2.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    SILVER CONTRIBUTOR
    Posted Dec 28, 2018 08:35 AM
    Hi Rudy

    When you go to General Ledger -> Setup -> Ledger do you have currencies setup for both the Accounting and Reporting currency?

    Thanks,


    ------------------------------
    Arush Kuthiala
    Western Computer
    Toronto ON
    ------------------------------

    AXUG Summit - Post


  • 3.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    TOP CONTRIBUTOR
    Posted Dec 28, 2018 10:02 AM
    Hi Arush.  Yes, both of those ​values are set up.

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------

    AXUG Summit - Post


  • 4.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    SILVER CONTRIBUTOR
    Posted Dec 28, 2018 11:00 AM
    Is a direct key invoice or a purchase order invoice?

    ------------------------------
    MARY LYNN KINCHEN
    Sr Systems Analyst
    SNF HOLDING COMPANY
    ------------------------------

    AXUG Summit - Post


  • 5.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    GOLD CONTRIBUTOR
    Posted Dec 28, 2018 12:28 PM
    Not sure what version you are using, but this is likely to be very similar across multiple versions of AX. From the technical (developer) side, the error message "A currency to convert from is required to retrieve exchange rate information." is from a system label (@SYS321714). In the label file (viewed from the label editor), it also contains the following description, "When looking for an exchange rate or an exchange rate multiplier, there is no From Currency. This is thrown from the Currency calculation engine."

    In AX 2012 R2, that label is found in only three places in the code:
    1. On line 6 of the validateFromCurrency method of the ExchangeRateHelper class,
    2. On line 45 of the getCompanyCurAmount method of the ExchangeRateForCurrenciesService class, and
    3. On line 31 of the getExchangeRateForCurrencies method of the ExchangeRateForCurrenciesService class.

    Granted, this may not sound very helpful (and that could be the case), but there is some insight that can be gleaned from this information.

    The first item listed is most likely the one it came from (in my uninformed opinion). It is called from numerous places in the code. It would be used for currency conversion processes within AX. This method is used to validate the "from" (source or transaction) currency of the transaction. This method evaluates the length of the "from" currency code. If it's length is zero, it displays the message you are seeing. A length of zero indicates that the "from" currency in this case is missing. This method does not validate whether or not the currency code is a valid code. It only checks to see if the code was empty/missing.

    If the process which is displaying the error is completely internal to AX, it would indicate that this first method is the source of the error message. Being internal to AX, it would most likely be caused by a setup issue (where a currency code was not provided) or possibly from a programming error in customized code (where it failed to provide a currency code for a transaction).

    The other two are from a different class, one that is labeled as a service class. The lines of code that contain the label with the error message contain code to throw an "AifFault". To quote the Microsoft documentation, "Microsoft Dynamics AX Application Integration Framework (AIF) enables companies to integrate and communicate with external business processes and partners through the exchange of XML over various transport media. AIF enables both business-to-business and application-to-application integration scenarios." In other words, they are used when receiving information from or when supplying information to another system which is external to Dynamics AX. The first of these two (item 2) tests to see if the transaction currency code passed into the method is an empty string (''). If so, it displays the error message. The second (item 3) tests the length of the "from" currency code string. If it is zero characters long, it displays the error message. While the two tests described take different approaches, the net result is the same. If the currency code it is testing is empty/missing, it displays the error message.

    If the process which is displaying the error is processing transactions from another system which is external to AX, it is most likely a data error from that system.

    I have mostly ignored the possibility that it comes from a process that provides information to another system because I believe that it is the least likely scenario. But, again, that is an uninformed opinion from someone unfamiliar with your processes. If the error message is from such a process, the causes would likely be internal to AX, meaning a setup issue or a programming error in customized code.

    I realize that I have not provided a specific answer to your question, but hopefully I have provided you some context around what is happening to help narrow the focus of your search.

    ------------------------------
    Kirk Blackburn
    Sr. Engineer - Software Development
    LDS Church
    UT
    ------------------------------

    AXUG Summit - Post


  • 6.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    TOP CONTRIBUTOR
    Posted Dec 31, 2018 08:41 PM
    whatever the currency of the invoice, in your Exchange Rates form you are missing either:
    conversion from invoice currency to Accounting Currency
    conversion from invoice currency to Reporting Currency.

    ------------------------------
    Zvika Rimalt
    Functional Consultant
    Vancouver BC
    ------------------------------

    AXUG Summit - Post


  • 7.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    TOP CONTRIBUTOR
    Posted Jan 03, 2019 11:40 AM
    Zvika, Accounting has confirmed that everything is set up properly in the Exchange Rates form.  Since we only transact in US Dollars there really should be no conversion issues, and if something was missing in the setup we would have encountered this error years ago.​

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------

    AXUG Summit - Post


  • 8.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    TOP CONTRIBUTOR
    Posted Jan 03, 2019 01:27 PM
    There is something that stands out as quite odd from the information you have provided so far.
    If you only ever transact in a single currency, what is the reason you have set Dynamics AX with a reporting currency?
    "Reporting Currency" is something that is only used where your company use more than one currency to report on its financials, so having this set up in your system single currency system might indicate there are other configuration issues in your system

    Back to your specific scenario - the issue experienced by your user, does it happen in all transactions or just in one particular invoice they were created?
    if the latter, can they re-produce the issue if they enter the exact same invoice in a separate new journal? maybe a user accidently selected something unusual in the problem journal and this is causing the error?
    Was that journal uploaded through an Excel add-on or types through the user interface?

    It is definitely a very unusual for a single current system in AX to get error messages about exchange rate.

    ------------------------------
    Zvika Rimalt
    Functional Consultant
    Vancouver BC
    ------------------------------

    AXUG Summit - Post


  • 9.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    Posted Jan 04, 2019 11:35 AM

    My company was sporadically receiving this error also. We are using AX 2012 R3 CU13.

    We traced it to a Microsoft code bug in the method calcHistoryInvoiceAmount of the PurchTableDocument class:


    In the outlined code block - the red highlighted line is causing the issue because the purchLine.CurrencyCode will always be blank(null) due to the select statement preceding the line.



    To correct, we replaced the highlighted block of code with:















    ------------------------------
    Richard Plodzik
    The Paslin Company
    ------------------------------

    AXUG Summit - Post


  • 10.  RE: "A currency to convert from is required to retrieve exchange rate information" error msg when posting AP invoice

    TOP CONTRIBUTOR
    Posted Jan 07, 2019 04:06 PM
    ​Richard, thanks for your solution.  We'll look into implementing it in order to avoid the error in the future.

    In the meantime, our Controller sent us this message regarding the error:

    "I couldn't get past this error but I think I was able to make our problem go away.  I manually added some on-hand quantities to the serial numbers to be able to reverse the PO receipt to get the PO back to an open order status. I tried re-receiving the lines and invoicing through but got the same error, so I reversed everything back to open again. The job is billed and paid complete and dropped from the system, so I can't create another PO/SO for the job, but what I can do is reclassify the journal entries that were created when I reversed the receipts list to the account we were trying to put them in to start."

    So for the invoice that received the error, it's no longer an issue.  But now that we know the code that probably caused the error, we'll want to take steps to avoid the error in the future by modifying the code as shown above.  Thanks everyone!

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------

    AXUG Summit - Post


If you've found this thread useful, dive deeper into User Group community content by role