I'm trying to 'print/post' payment batches in AP from an external program. I'm at my wits end.. using the macro recorder, it seems fairly clear, but I've had no luck mimicing the macro.
Here's a snippet of my code;
-------
Dim BKPROC As xapiView
Set BKPROC = hSession.OpenView("BK0105", "BK")
MsgBox "Exists: " & BKPROC.Exists
BKPROC.Fields("PROCESS").PutWithoutVerification ("1") ' Bank Process
BKPROC.Process
Dim rpt As xapiReport
Set rpt = New xapiReport
rpt.Select hSession, "BKCHKSTK[" & vReport & "]", ""
rpt.SetParam "APPRUNNUM", vBatchID ' Report parameter: 9
rpt.SetParam "EXTPARAM1", "2" ' Report parameter: 6
rpt.SetParam "EXTPARAM2", " " ' Report parameter: 7
rpt.SetParam "EXTPARAM3", " " ' Report parameter: 8
rpt.PrintDestination = PD_PREVIEW
rpt.PrintReport 1
BKPROC.Fields("OPERATION").PutWithoutVerification ("1") ' Process Status
BKPROC.Process
Set rpt = Nothing
Set BKPROC = Nothing
---------
hSession is already open. the report runs fine, but everything is supressed and just '** VOID **' is shown.
I am able to trace the problem right back to the following line;
Set BKPROC = hSession.OpenView("BK0105", "BK")
hSession is an open and valid session.. I've trided replacing the "BK" with "AP" and "" to no avail.
immediatley after this statement, BKPROC.Exists has a value of -1.
Any help with be greatly appreciated.. I've been struggling with this for quite some time now.
My 'post' method also doesn't work at the moment.. but one problem at a time!
Here's a snippet of my code;
-------
Dim BKPROC As xapiView
Set BKPROC = hSession.OpenView("BK0105", "BK")
MsgBox "Exists: " & BKPROC.Exists
BKPROC.Fields("PROCESS").PutWithoutVerification ("1") ' Bank Process
BKPROC.Process
Dim rpt As xapiReport
Set rpt = New xapiReport
rpt.Select hSession, "BKCHKSTK[" & vReport & "]", ""
rpt.SetParam "APPRUNNUM", vBatchID ' Report parameter: 9
rpt.SetParam "EXTPARAM1", "2" ' Report parameter: 6
rpt.SetParam "EXTPARAM2", " " ' Report parameter: 7
rpt.SetParam "EXTPARAM3", " " ' Report parameter: 8
rpt.PrintDestination = PD_PREVIEW
rpt.PrintReport 1
BKPROC.Fields("OPERATION").PutWithoutVerification ("1") ' Process Status
BKPROC.Process
Set rpt = Nothing
Set BKPROC = Nothing
---------
hSession is already open. the report runs fine, but everything is supressed and just '** VOID **' is shown.
I am able to trace the problem right back to the following line;
Set BKPROC = hSession.OpenView("BK0105", "BK")
hSession is an open and valid session.. I've trided replacing the "BK" with "AP" and "" to no avail.
immediatley after this statement, BKPROC.Exists has a value of -1.
Any help with be greatly appreciated.. I've been struggling with this for quite some time now.
My 'post' method also doesn't work at the moment.. but one problem at a time!