web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

"Attempted to divide by zero" error message in Purchase order

(1) ShareShare
ReportReport
Posted on by 24
Hi Community,
 
I need your help: this error message /Attempted to divide by zero/ appears when posting a purchase order, for both stocked and non-stocked items. How to resolve this please ?
 
I have the same question (4)
  • YUN ZHU Profile Picture
    97,089 Super User 2025 Season 2 on at
    Hi, it seems to be a problem caused by customization. If there is "A / 0" in the code, this error will occur.
    It is recommended that you contact your partner.
     
    Thanks
    ZHU
  • Maryem Ayouni Profile Picture
    24 on at
    Thank you for your reply YUN ZHU.
     
    In our case this error occurs from an incorrect creation of a value entry where "ItemLedgEntryQty = 0" which led to the attempted to divide by zero message in the standard method when dividing ShareOfTotalCost := OutbndValueEntry."Valued Quantity" / ItemLedgEntryQty;  of the codunit 5895 "Inventory Adjustment"
     
     
    Could you help please ? Could we correct/modify the lines above ??
  • Suggested answer
    keoma99 Profile Picture
    138 on at
    Please first check, if there is an extension, which has to do with posting purchase orders.
    This should be checked by your it partner, who did the customizations. otherwise the code changes were maybe made by internal colleagues.
    You can check extensions in page extension management.
    The screenshot you sent has probably nothing to do with that.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,167

#2
Dhiren Nagar Profile Picture

Dhiren Nagar 1,184

#3
YUN ZHU Profile Picture

YUN ZHU 1,161 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans