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

Announcements

No record found.

News and Announcements icon
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 48
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
    99,377 Super User 2026 Season 1 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
    48 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
    146 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,717 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 995 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 628 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans