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

Community site session details

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

Payment Tolerance Error - Divide By Zero

(1) ShareShare
ReportReport
Posted on by 81
Reaching out to see if anyone has had a similar situation: Intermittently when applying customer payments in Us Dollars (LCY) against invoices in Foreign Currency (EUR) when there are more than one ,when there is a payment tolerance, we recieve the Payment Tolerance Warning and if we say to apply it as a payment tolerance, one of 2 things occurs
1) either we receive a divide by zero error
2) the system frreezes up and we have to end the sesssion
 
I have traced the issue to:
codeunit 426 "Payment Tolerance Management"
 
local procedure PutCustPmtTolAmount(CustledgEntry: Record "Cust. Ledger Entry"; Amount: Decimal; AppliedAmount: Decimal; CustEntryApplID: Code[50])
 
On line 1031 - This is the divide by zero error where total amount is zero
AcceptedEntryTolAmount := Round((AppliedCustLedgEntry.Amount / TotalAmount) * AcceptedTolAmount);
 
It seems to be an issue with the loop on line 1013
f AppliedCustLedgEntry.FindSet(true) then
 
for some reason when : AppliedCustLedgEntry.Modify(); is run and then the
until AppliedCustLedgEntry.Next() = 0;  doesnt seem to adnace the record?  This either results in a divide by zero or and endless loop
 
It doesn't appear this codeunit was changed recently - Any guidance would be very helpful as I have been going down the rabbit hole of payment tolerance management with no success
 
 
I have the same question (0)

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 2,568

#2
Sumit Singh Profile Picture

Sumit Singh 2,536

#3
YUN ZHU Profile Picture

YUN ZHU 2,015 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans