Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create restart records in Macro VBA

Status
Not open for further replies.

PhilDOakley

IS-IT--Management
Feb 16, 2017
7
0
0
GB
I am pushing a csv file into a GL journal using a VBA macro and want it to use the restart method as it fails sometimes. Is it possible to implement this?
 
You can use AccpacDBLink.TransactionBegin, AccpacDBLink.TransactionCommit, AccpacDBLink.TransactionRollback
Caveat: other users will be locked out of creating GL batches until you commit or rollback.
I use this in many cases where importing transactions, especially when it is automated.
The other thing to do is validate the heck out of the source data before importing.

Sage 300 Certified Consultant
 
And by importing I don't mean using the Sage 300 import engine - it sucks. I use the views and write to the batch, header and detail views.

Sage 300 Certified Consultant
 
Exclusive access will not be an issue as this will run over night. I will try the AccpacDBLink.TransactionBegin and see how it goes
 
Is there any documentation on this as I can see there is a AccpacDBLink.TransactionBegin and AccpacDBLink.TransactionBegin2?
 
No - you have to wing it.
Open a macro screen and press F2, then select AccpacCOMAPI from the top dropdown list.
Select AccpacDBLink under Classes and TransactionBegin under Members - you will get a very brief description at the bottom.
That's about as good as it gets.

Function TransactionBegin(pTransLevel As Long) As Long
Member of AccpacCOMAPI.AccpacDBLink
Begins a transaction on the current DB Link.

Function TransactionBegin2(pTransLevel) As Long
Member of AccpacCOMAPI.AccpacDBLink
Begins a transaction on the current DB Link. Script languages should use this function.

As you can see the "2" is for scripting.

Sage 300 Certified Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top