Problem:
When you approve pending subcontract payments in Microsoft Dynamics SL, the following error appears:
Payment Approval process update aborted. Error = 5 on BATCH.

Solution:
This error occurs because the value in APSETUP has the wrong LastBatNbr.
Have your SQL Admin run the following script:
begin tran declare @RealNext VARCHAR(63) = (select max(batnbr) from dbo.batch where module = 'AP') update dbo.apsetup set LastBatNbr = @RealNext where LastBatNbr < @RealNext rollback
KBA-01914; Last updated: March 13, 2026 at 12:05 pm
