×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Bank Process Control (BK0105)

Bank Process Control (BK0105)

Bank Process Control (BK0105)

(OP)
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!

RE: Bank Process Control (BK0105)

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.

RE: Bank Process Control (BK0105)

(OP)
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.

RE: Bank Process Control (BK0105)

(OP)
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.

RE: Bank Process Control (BK0105)

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.

RE: Bank Process Control (BK0105)

(OP)
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?

RE: Bank Process Control (BK0105)

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.

RE: Bank Process Control (BK0105)

(OP)
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..  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close