Search code examples
axaptax++dynamics-ax-2012

Function SalesTable2LineField.lineUpdateDescription has been used incorrectly


In Dynamics AX 2012, when trying to update the value of the field DlvMode or adding a new delivery address in the sales order (through the Header view), I keep getting this error:

Function SalesTable2LineField.lineUpdateDescription has been used incorrectly

There's no customization in this method or this class.


Solution

  • This is something that could be debugged in 15 minutes if you had a developer. My guess would be that you are using one of these country codes:

    1. AT,BE,CZ,DK,EE,FI,FR,DE,HU,IE,IT,LV,LT,NL,PL,ES,SE,GB,RU,MY (SalesTable_W)
    2. BR (SalesTable_BR)
    3. IN (SalesTable_IN)

    In \Classes\SalesTable2LineField\lineUpdateDescription at the very end, immediately above the throw error... line add this:

    info(strFmt("Offending table is %1 (%2)", tableId2name(tableId), tableId));

    You should also add a breakpoint if that alone doesn't help and figure it out.

    Then repeat the operation, and you will know the table. It's possible it's just a Microsoft bug or if \Forms\SalesTable has been modified, it could be that. You just need to debug it.

    enter image description here