I have a method to retrieve open and ready AR batches and populate an ADO recordset for passing back to the calling program. Since upgrading to 5.1A, my client is now only seeing 1 batch record coming back from this method.
Unfortunately, I don't have an easy way to "debug" this for them. Can someone please take a look at this code and let me know if you see anything "funny"? I'm assuming the Fetch inside the loop is not returning True and it falls out of the loop.
Public Sub Batch_List()
On Error GoTo ACCPACErrorHandler
Dim lStatus As Boolean
ARINVOICE1batch.Cancel
' ARINVOICE1batch.Order = 0
ARINVOICE1batch.Browse "BTCHSTTS = 7 OR BTCHSTTS = 1", True
lStatus = ARINVOICE1batch.Fetch
' Clear ADO recordset
If oArBatch.RecordCount > 0 Then
' oArBatch.Delete adAffectGroup
oArBatch.CancelBatch
End If
' Populate ADO recordset
Do While lStatus = True
oArBatch.AddNew
oArBatch.Fields("CNTBTCH".Value = ARINVOICE1batch.Fields("CNTBTCH".Value
oArBatch.Fields("BTCHDESC".Value = ARINVOICE1batch.Fields("BTCHDESC".Value
oArBatch.Fields("DATEBTCH".Value = ARINVOICE1batch.Fields("DATEBTCH".Value
oArBatch.Fields("BTCHTYPE".Value = ARINVOICE1batch.Fields("BTCHTYPE".Value
oArBatch.Fields("BTCHSTTS".Value = ARINVOICE1batch.Fields("BTCHSTTS".Value
oArBatch.Fields("CNTINVCENT".Value = ARINVOICE1batch.Fields("CNTINVCENT".Value
oArBatch.Fields("AMTENTR".Value = ARINVOICE1batch.Fields("AMTENTR".Value
lStatus = ARINVOICE1batch.Fetch
Loop
ARINVOICE1batch.Cancel
Exit Sub
ACCPACErrorHandler: 'Display error messages
SetErrorMessage
Exit Sub
End Sub
Unfortunately, I don't have an easy way to "debug" this for them. Can someone please take a look at this code and let me know if you see anything "funny"? I'm assuming the Fetch inside the loop is not returning True and it falls out of the loop.
Public Sub Batch_List()
On Error GoTo ACCPACErrorHandler
Dim lStatus As Boolean
ARINVOICE1batch.Cancel
' ARINVOICE1batch.Order = 0
ARINVOICE1batch.Browse "BTCHSTTS = 7 OR BTCHSTTS = 1", True
lStatus = ARINVOICE1batch.Fetch
' Clear ADO recordset
If oArBatch.RecordCount > 0 Then
' oArBatch.Delete adAffectGroup
oArBatch.CancelBatch
End If
' Populate ADO recordset
Do While lStatus = True
oArBatch.AddNew
oArBatch.Fields("CNTBTCH".Value = ARINVOICE1batch.Fields("CNTBTCH".Value
oArBatch.Fields("BTCHDESC".Value = ARINVOICE1batch.Fields("BTCHDESC".Value
oArBatch.Fields("DATEBTCH".Value = ARINVOICE1batch.Fields("DATEBTCH".Value
oArBatch.Fields("BTCHTYPE".Value = ARINVOICE1batch.Fields("BTCHTYPE".Value
oArBatch.Fields("BTCHSTTS".Value = ARINVOICE1batch.Fields("BTCHSTTS".Value
oArBatch.Fields("CNTINVCENT".Value = ARINVOICE1batch.Fields("CNTINVCENT".Value
oArBatch.Fields("AMTENTR".Value = ARINVOICE1batch.Fields("AMTENTR".Value
lStatus = ARINVOICE1batch.Fetch
Loop
ARINVOICE1batch.Cancel
Exit Sub
ACCPACErrorHandler: 'Display error messages
SetErrorMessage
Exit Sub
End Sub