Divsion by zero

sabzamsabzam Member Posts: 1,149
Hi all, i have a problem when posting a purchase invoice. during posting it adjusts value entries and diaplys division by zero error. any idea from where it can be originating?

Comments

  • matttraxmatttrax Member Posts: 2,309
    Turn on the debugger and check it out. My first guess would be a quantity and that it is trying to divide an amount by that quantity to get a unit amount.
  • sabzamsabzam Member Posts: 1,149
    i found the error its originating from codeunit 5895 in the CalcCostPerUnit, but there are no customisations done on this function
  • matttraxmatttrax Member Posts: 2,309
    Well if you found the error you should be able to trace it back to how the value is calculated.

    If it's dividing by a field, look at that field. If it's just a variable, you should be able to look at the code and see where the calculation happens.
  • KowaKowa Member Posts: 923
    As a workaround, you can also uncheck "Automatic Cost Adjustment" in the "Inventory Setup" to get the purchase posted and then do the adjustment manually later by running the "Adjust Cost - Item Entries" Report to see if the error occurs there too.
    Kai Kowalewski
Sign In or Register to comment.