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

Notifications

Announcements

No record found.

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
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 (0)
  • YUN ZHU Profile Picture
    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
    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
    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

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans