Plus Community - for users of ACCPAC & Adagio accounting software

Welcome to the PlusCommunity forums! PlusCommunity is a gathering place for companies running Simply Accounting, ACCPAC Plus, Sage Accpac ERP (ACCPAC Advantage/ACCPAC for Windows), and Adagio Accounting.
New visitors, please click here!

Page 1 of 1 1
Topic Options
#53732 - 09/21/18 12:11 PM Can I Mark Multiple GL Batches "Ready to Post"
Howard Frazier
Member


Registered: 11/23/00
Posts: 64
Loc: Redmond, WA
I have a client that does not post to their GL regularly. They call on me 2 or 3 times a year to post GL batches and produce financials. Since they always have hundreds of GL batches to post, I'm looking for some method of marking all the batches "Ready to Post" without having to do each batch individually.

I cannot find any of the 'common' ways to do this in the UI.

The installed version is Sage 300, 2014.

Thanks,
Howard

Top
#53733 - 09/21/18 12:24 PM Re: Can I Mark Multiple GL Batches "Ready to Post" [Re: Howard Frazier]
Jay Converse Administrator
Member


Registered: 07/31/00
Posts: 7684
Loc: Location, Location
Sub MainSub()
'
' Sage 300 Macro file: C:\Data\Macros\make batches post.avb
' Recorded at: Fri Sep 21 16:19:30 2018
'

On Error GoTo ACCPACErrorHandler

Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)

Dim GLBATCH1batch As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "GL0008", GLBATCH1batch

Dim GLBATCH1header As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "GL0006", GLBATCH1header

Dim GLBATCH1detail1 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "GL0010", GLBATCH1detail1

Dim GLBATCH1detail2 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "GL0402", GLBATCH1detail2

GLBATCH1batch.Compose Array(GLBATCH1header)
GLBATCH1header.Compose Array(GLBATCH1batch, GLBATCH1detail1)
GLBATCH1detail1.Compose Array(GLBATCH1header, GLBATCH1detail2)
GLBATCH1detail2.Compose Array(GLBATCH1detail1)


Dim GLPOST2 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "GL0030", GLPOST2


GLBATCH1batch.Browse "BATCHSTAT = 1", True

Do While GLBATCH1batch.Fetch
GLBATCH1batch.Fields("PROCESSCMD").PutWithoutVerification ("2") ' Lock Batch Switch
GLBATCH1batch.Process
GLBATCH1batch.Fields("RDYTOPOST").Value = "1" ' Ready to Post
GLBATCH1batch.Update
GLBATCH1batch.Fields("PROCESSCMD").PutWithoutVerification ("0") ' Lock Batch Switch
GLBATCH1batch.Process
Loop

MsgBox "Done"


Exit Sub

ACCPACErrorHandler:
Dim lCount As Long
Dim lIndex As Long

If Errors Is Nothing Then
MsgBox Err.Description
Else
lCount = Errors.Count

If lCount = 0 Then
MsgBox Err.Description
Else
For lIndex = 0 To lCount - 1
MsgBox Errors.Item(lIndex)
Next
Errors.Clear
End If
Resume Next

End If

End Sub
_________________________
Jay Converse
Sage 300 Whisperer

Top
#53734 - 09/21/18 12:51 PM Re: Can I Mark Multiple GL Batches "Ready to Post" [Re: Jay Converse]
Howard Frazier
Member


Registered: 11/23/00
Posts: 64
Loc: Redmond, WA
Fantastic! Thanks, Jay.
Top
#53735 - 09/21/18 07:43 PM Re: Can I Mark Multiple GL Batches "Ready to Post" [Re: Howard Frazier]
Howard Frazier
Member


Registered: 11/23/00
Posts: 64
Loc: Redmond, WA
Jay, when I run the macro you provided I get an error message:
"Line 65535 0 Expecting END LOOP, found EOF"

I copied the text in the macro above into a text file named: make batches post.avb

From within Sage I selected "Run Macro" and navigated to the avb file with the contents above, select 'Open,' and then error message appears.

Any idea why this isn't running properly?


Edited by Howard Frazier (09/21/18 07:43 PM)

Top
#53736 - 09/22/18 02:39 AM Re: Can I Mark Multiple GL Batches "Ready to Post" [Re: Howard Frazier]
Jay Converse Administrator
Member


Registered: 07/31/00
Posts: 7684
Loc: Location, Location
You copied and pasted it wrong.
_________________________
Jay Converse
Sage 300 Whisperer

Top
#53737 - 09/22/18 08:37 AM Re: Can I Mark Multiple GL Batches "Ready to Post" [Re: Jay Converse]
Howard Frazier
Member


Registered: 11/23/00
Posts: 64
Loc: Redmond, WA
Yeah, I sure did. Working now after learning (re-learning) macro handling.
Top
Page 1 of 1 1


Moderator:  Jay Converse 
Hop to: