Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

System error 6125 when trying to post an AR Invoice batch

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to post a batch of AR invoices and I am getting the following error message:

System Message 6124: Process started: Fri Dec 04 10:46 A.M.

Module: 'AR'
Batch: '010876'

Processing: Module: 'AR' , Batch: '010876'
An unexpected error has occurred while releasing batch '010876' . Please contact Microsoft Support for assistance with this batch. Release has been cancelled.

System Message 6125: Process ended: Fri Dec 04 10:46 A.M.

How can I resolve this?

Thanks

Leah

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System error 6125 when trying to post an AR Invoice batch

    The AR needs to be in single quotes as does the batnbr value.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System error 6125 when trying to post an AR Invoice batch

    When I ran this query:

    select * from ARTran where BatNbr = 010876 an ARTran query

    I came up with 0 row affected

    When I ran this query

    update Batch set EditScrnNr = 08010 where Module = AR and BatNbr = 010876

    I got the following error message:

    Msg 207, Level 16, State 1, Line 5

    Invalid column name 'AR'.

    What did I do wrong?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System error 6125 when trying to post an AR Invoice batch

    It appears that you have an ARTran item where the curytranamt does not equal the tranamt but not currency info.  It also appears that the batch record does not have an editscrnnbr.  I would run the following query:

    select * from ARTran where batnbr = 'nnnnnn' and curytranamt <> tranamt.  If you are not dealing with multi-currency and it finds something, try the following:

    update ARTran set curytranamt = tranamt where batnbr = 'nnnnnn'

    I do not think the missing editscrnnbr in the batch record is you problem but it normally would contain 08010.  You could run the following to fix that:

    update batch set editscrnnbr = '08010' where module = 'AR' and batnbr = 'nnnnnn'

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System error 6125 when trying to post an AR Invoice batch

    I ran the ARDebug and got the following - now what do I d?

    Declare @batchnbr varchar(6) = 010876

    execute ARDebug @batchnbr

    (0 row(s) affected)

    (0 row(s) affected)

    (0 row(s) affected)

    (0 row(s) affected)

    (0 row(s) affected)

    (1 row(s) affected)

    04 Dec 2015 22:37:26:653

    Debug...Step 100:  Starting AR Release: yyyy-mm-dd Rev: 1

    Debug:  Clear worktables

    04 Dec 2015 22:37:26:653

    Debug...Step 200:  Declare variables

    04 Dec 2015 22:37:26:653

    04 Dec 2015 22:37:26:653

    Debug...Step 300:  Remove exceptions

    04 Dec 2015 22:37:26:653

    Debug...Step 300-100:  Clear records for voided batches

    04 Dec 2015 22:37:26:653

    Debug...Step 300-200:  Clearing voided PA docs

    04 Dec 2015 22:37:26:667

    Debug...Step 300-300:  Clearing voided trans docs

    04 Dec 2015 22:37:26:667

    Debug...Step 300-400:  Clearing voided IN docs

    04 Dec 2015 22:37:26:770

    Debug...Step 300-500:  Voiding batches

    04 Dec 2015 22:37:26:770

    Debug...Step 300-600:  Clearing wrkrelease for voided batches

    04 Dec 2015 22:37:26:770

    Debug...Step 300-700:  Remove batches that are/will be out of balance.

    Debug...Show which SELECT will remove batch.

    CuryTranAmt <> TranAmt with no rate change.

    04 Dec 2015 22:37:26:800

    Debug...Step 300-800:  Remove FROM wrkrelease all wrkreleasebad batches.

    04 Dec 2015 22:37:26:830

    Debug...Step 350:  Get EditScrnNbr and Batch info at batch lock time

    Batch Diagnostics

    Error 12319, Batch record is missing or Batch has blank Edit Screen Number.

    Batch Output

    ArDoc Output

    ARTran Output

    Rolling back transaction

    (1 row(s) affected)

    (0 row(s) affected)

    (1 row(s) affected)

    (0 row(s) affected)

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System error 6125 when trying to post an AR Invoice batch

    Leah,

    You may have to open an incident with Microsoft on this as the error message does not provide any clue as to the issue.

    I see that you indicated the error occurs during "posting".  Some users interchange "posting" with "releasing" so we should clarify if this error occurs during the releasing of the batch or the posting of the batch to GL.

    I did run across an old SQL script that the support group created to assist with problems during the releasing of an AR batch.  This script was called AR_6019_DEBUG.sql.  I have included its content below.  Not sure if this will help or not.  It does mean that you have to have access to SQL Server Management Studio in order to run it and that you have to be able to interpret the results.  Also, since the script is fairly old, some of its logic may not apply to the more current versions of SL but I would give it a try.

    /*

    +-----------------------------------------------+

    |AR 6019 Debug Script v2.3 |

    |Modified 5/15/06       |

    | - Added SQL 2005 instructions |

    | - Added sys msg 8058 debug |

    | - added section or pre-pay applic batches |

    | - 3 calculated field on related invoices |

    | - gets related invoice and pmts on rlsed batch|

    +-----------------------------------------------+

    IF YOU ARE USING SQL 2000 DO THE FOLLOWING:

    1 - Open the script in Query Analyzer

    2 - On the toolbar select Tools -> Options -> Results

    a - Set "Default results target" to "Results to Text"

    b - Set "Results output format" to "Tab Delimited"

    c - Click the OK Button.

    3 - Replace the XXXXXX with your 6 digit batch number.

    4 - Run the script (F5).

    5 - After the script has run, click on the results part of the screen.

    6 - Select File/Save As/IncidentAP.rpt.  

    7 - Zip this file and attach it to the incident.

    ----------------------------------------------------------------------------

    IF YOU ARE USING SQL 2005 DO THE FOLLOWING:

    1 - Open the script in SQL Server Management Studio

    2 - On the toolbar select Tools -> Options -> Query Results -> SQL Server

    a - Click on Results to Text

    b - Set the Output Format to Tab Delimited

    c - Click OK

    3 - On the tollbar, select Query -> Results To -> Results to Text

    4 - Replace the XXXXXX with your 6 digit batch number.

    5 - Run the script (F5).

    6 - After the script has run, click on the results part of the screen.

    7 - Select File/Save As/IncidentAP.rpt.  

    8 - Zip this file and attach it to the incident.

    */

    DECLARE @batchNumber varchar(6)

    DECLARE @getPaymentDocs varchar(3)

    DECLARE @getInvoiceDocs varchar(3)

    DECLARE @getPaymentTrans varchar(3)

    DECLARE @getInvoiceTrans varchar(3)

    DECLARE @getCashManager varchar(3)

    -- Change XXXXXX to the suspended batch number

    SET @batchNumber = 'XXXXXX'

    -- Set to YES to view related invoice docs.  Set to NO to skip

    SET @getInvoiceDocs = 'YES'

    -- Set to YES to view related payment docs.  Set to NO to skip

    SET @getPaymentDocs = 'YES'

    -- Set to YES to view related cash manager records.  Set to NO to skip

    SET @getCashManager = 'YES'

    -- Quick error check to see if the application database was selected

    if not exists (select * from sysobjects where id = object_id(N'[dbo].[Batch]'))

    begin

     print 'Error: BATCH table not found.  Please select your Solomon Application'

     print '       database from the drop-down menu in the Query Analyzer toolbar.'

     return

    end

    -- Quick error check to see if the batch record was found

    if ((select count(*) from batch where batnbr = @batchNumber AND module = 'AR')=0)

    begin

     print 'Error: BATCH record not found.  Please double check the value set for'

     print '       @batchNumber and make sure the correct application database is'

     print '       selected.  Current value for @batchNumber: ' + @batchNumber

     return

    end

    Print '############################# VERSION INFO ####################'

    Print 'GLSetup'

    select s4future01, cpnyid, basecuryid , 'V2.3' as DebugScriptVersion from glsetup

    select @@version as 'SQL Server'

    Print '############################# BEGIN 6019 #####################'

    Print 'BATCH'

    SELECT Batnbr,Status,Rlsed,EditScrnnbr,Crtot,Drtot,Ctrltot,CuryCrtot,CuryDrtot,CuryCtrltot,*

     FROM Batch

    WHERE batnbr = @batchNumber AND module = 'AR'

    Print 'ARDoc'

    SELECT Batnbr,ApplBatNbr,Custid,Doctype,Refnbr,Rlsed,Docbal,origdocamt,curydocbal,curyorigdocamt,*

     FROM ARDoc

    WHERE batnbr = @batchNumber

    ORDER BY refnbr

    Print 'ARTran'

    SELECT Batnbr,Custid,Trantype,Refnbr,siteid,DRCR,Rlsed,Tranamt,CuryTranamt,*

     FROM ARTran

    WHERE batnbr = @batchNumber

    ORDER BY refnbr

    Print 'Sum of ARTrans'

    SELECT Batnbr,Custid,Trantype,Refnbr,SumTranAmt = Sum(Tranamt), SumCuryTranAmt = Sum(CuryTranamt),

          sumCuryTaxamt00 = sum(curyTaxAmt00), sumCuryTaxamt01 = sum(CuryTaxAmt01),

          sumCuryTaxamt02 = sum(curyTaxAmt02), sumCuryTaxamt03 = sum(CuryTaxAmt03)

     FROM ARTran

    WHERE batnbr = @batchNumber

    GROUP By batnbr,custid,Trantype,refnbr

    Print 'ArAdjust'

    Select * from ArAdjust where adjbatnbr = @batchNumber

    ORDER BY adjdrefnbr

    Print 'GLTran'

    Select * from GLTran where batnbr = @batchNumber and module = 'ar'

    IF @getInvoiceDocs = 'YES' and ((select count(*) from ARTran WHERE batnbr = @batchNumber and siteid<>'')>0

    or (select count(*) from aradjust where adjbatnbr=@batchNumber)>0)

    BEGIN

    Print '############################# RELATED INVOICE DOCS ####################'

    Print 'ARDOC (invoices)'

    Print '     xAmountApplied, xDiscApplied, and xMinCuryTxblAmt00 are calculated fields based on the artrans in batch ' + @batchNumber

    Print ''

    select

    Batnbr,ApplBatNbr,Custid,Doctype,Refnbr,Rlsed,Docbal,origdocamt,curydocbal,curyorigdocamt,

    (select sum(tranamt) from artran where artran.siteid=ardoc.refnbr and artran.batnbr=@batchNumber) as xAmountApplied,

    (select sum(CnvFact) from artran where artran.siteid=ardoc.refnbr and artran.batnbr=@batchNumber) as xDiscApplied,

    (select min(curytxblamt00) from artran where artran.siteid=ardoc.refnbr and artran.batnbr=@batchNumber) as xMinCuryTxblAmt00,

    *

    from ardoc

    where refnbr IN (select distinct(siteid) from ARTran WHERE batnbr = @batchNumber)

    and custid IN (select distinct(custid) from ARTran WHERE batnbr = @batchNumber)

    and batnbr <> @batchNumber

    union all

    select

    Batnbr,ApplBatNbr,Custid,Doctype,Refnbr,Rlsed,Docbal,origdocamt,curydocbal,curyorigdocamt,0,0,0,*

    from ardoc

    where refnbr IN (select adjdrefnbr from aradjust WHERE adjbatnbr = @batchNumber)

    and custid IN (select distinct(custid) from aradjust WHERE adjbatnbr = @batchNumber)

    order by refnbr, batnbr

    END

    IF @getPaymentDocs='YES' and ((select count(*) from ardoc where ApplBatNbr=@batchNumber and batnbr<>@batchNumber)>0

    or (select count(*) from aradjust where adjbatnbr=@batchNumber)>0)

    BEGIN

    Print '############################# RELATED PAYMENT DOCS ####################'

    Print 'ARDOC (payments)'

    select Batnbr,ApplBatNbr,Custid,Doctype,Refnbr,Rlsed,Docbal,origdocamt,curydocbal,curyorigdocamt,*

    from ardoc

    where ApplBatNbr=@batchNumber and batnbr <> @batchNumber

    union all

    select Batnbr,ApplBatNbr,Custid,Doctype,Refnbr,Rlsed,Docbal,origdocamt,curydocbal,curyorigdocamt,*

    from ardoc

    where refnbr IN (select adjgrefnbr from aradjust WHERE adjbatnbr = @batchNumber)

    and custid IN (select distinct(custid) from aradjust WHERE adjbatnbr = @batchNumber)

    and batnbr <> @batchNumber

    order by refnbr, batnbr

    END

    IF (@getCashManager = 'YES') and ((select Crtd_Prog from batch where batnbr = @batchNumber AND module = 'AR') = '20400')

    BEGIN

    Print '############################# RELATED CASH MANAGER RECORDS###############'

    DECLARE @CABatNbr varchar(6)

    SET @CABatNbr = (select origbatnbr from batch where batnbr = @batchNumber AND module = 'AR')

    Print 'Originating Cash Manager BATCH'

    SELECT Batnbr,Status,Rlsed,EditScrnnbr,Crtot,Drtot,Ctrltot,CuryCrtot,CuryDrtot,CuryCtrltot,*

     FROM Batch

    WHERE batnbr = @CABatNbr AND module = 'CA'

    Print 'CATran'

    SELECT Batnbr,Refnbr,DRCR,Rlsed,Tranamt,CuryTranamt,*

     FROM CATran

    WHERE batnbr = @CABatNbr

    ORDER BY refnbr

    END

    IF (select count(*) from batch where batnbr=@batchNumber and curyid not in (select curyid from currncy))>0

    BEGIN

    Print '############# BATCHES WITH SAME NUMBER WITH BAD CURYID (Sys Msg 8058) ######'

    print 'BATCH'

    select batnbr, module, status, curyid, basecuryid, * from batch where batnbr=@batchNumber and curyid not in (select curyid from currncy)

    END

    if (SELECT count(*) FROM sysobjects WHERE id = object_id('AP_PPApplicBat'))>0 print 'TRUE' else print 'FALSE'

    Print '############################# BEGIN ARDEBUG ####################'

    EXECUTE ARDebug @batchNumber

    Print '############################# END OF FILE #####################'

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System error 6125 when trying to post an AR Invoice batch

    Thanks for the tips but we tried to post this from different workstations and that did not work.  All of the currency values are fine.  Any other suggestions?

    Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System error 6125 when trying to post an AR Invoice batch

    Leah,

    This error does not give us much to go on.  I would first suggest that you reboot the workstation and try releasing the batch again from the release batch screen (just to make sure the problem is not related to a corrupted DLL in memory).  If that does not correct the problem then you might check the curryid value in the ARDocs of the batch.  Some time back I got a similar error and found that one of the documents in the batch ended up with an invalid currency id.  This is a long short but worth investigating.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans