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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bank Process Control (BK0105)

Status
Not open for further replies.

mork571

Programmer
Nov 24, 2003
13
0
0
CA
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!
 
I don't know why you're using BK views to post AP payments. The code is something like this:

mDBLinkCmpRW.OpenView "AP0040", ApPostPayment
mDBLinkCmpRW.OpenView "AP0030", ApPaymentBatch

ApPaymentBatch.Fields("PAYMTYPE").PutWithoutVerification ("PY") ' Batch Selector
ApPaymentBatch.Fields("CNTBTCH").PutWithoutVerification (sCurrentBatch) ' Batch Number
ApPaymentBatch.Read
ApPaymentBatch.Fields("BATCHSTAT") = 7
ApPaymentBatch.Fields("SWPRINTED") = 1
ApPaymentBatch.Update

ApPostPayment.Fields("TYPEBTCH") = "PY"
ApPostPayment.Fields("BATCHIDFR").PutWithoutVerification (sCurrentBatch) ' From Batch
ApPostPayment.Fields("BATCHIDTO").PutWithoutVerification (sCurrentBatch) ' To Batch
ApPostPayment.Process


Jay Converse
IT Director
Systemlink, Inc.
 
Thanks,

I had been trying that for posting as well. That technique doesn't work for some reason either.

An 'Error Batch' is created (identical to the batch I attempt to post).

the only errors in the session view are;
hSession.Errors: Posting Complete. Error Batch Created.
hSession.Errors: No records processed.

still working on it here. I am able to post AP Invoice batches by a similar means without issue.

Still have not been able to print either.

Thanks for your help, any further advice would be appreciated.
 
actually, I should note, the status of the batch does end up being 'Posted', but the error batch is still generated and things don't seem to show up in the GL.
 
If you get an error batch, then print the Posting Errors report in A/P to see what the problem is.

Jay Converse
IT Director
Systemlink, Inc.
 
The error batch is to the effect of 'duplicate check number 000000000' for each check in the batch.

The payments in these batches have SWPRNTRMIT set to TRUE. When I record the macro's, it seems like they are merely calling the crystal report. I'm not sure how things tie together with respect to generating check numbers for the checks. (hopefully that all made sense).

I assumed that the BK0101 view had a hand in it since it makes an appearance in the recorded macros. However, it's not clear to me at all what it is actually doing (if anything).

If I have a batch where I have manually entered check numbers, the posting process from an external application does work.

At this stage I feel like I'm missing a step that assigns the check numbers. I thought this would be automated by some process by Accpac - is this incorrect?
 
LOL!

The code I send you was from an integration I did where the check number was generated by an external system. In this case, I had to set:

ApPaymentHeader.Fields("SWPRNTRMIT").Value = "0"

which means don't print the check, and

ApPaymentHeader.Fields("IDRMIT").Value = sCheckNum

which is some number.

Are you intending this payment batch to actually print checks? In that case, you need to do a recording where the Print/Post button is selected. I've never tried that, because the times I created payment batches that needed to be printed, the users took over from there.


Jay Converse
IT Director
Systemlink, Inc.
 
Yup.

I have been recording the stuff occuring from the 'print/post' button.

At that point, there is a field 'Next Check Num' and it does assign check numbers to the payments.. but none of that magic seems to show up in the recorded macro's at all.

But yup, the plan is for the program to try to print the checks and prompt the user "did the checks print?" (similar to Accpac's 'print/post'), and post the batch if it was yes.

I'm assuming the report is also failing due to lack of check numbers as well.

thanks for your help thus far! I feel like I'm getting closer and closer..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top