I have done scripts to automate transaction registers in several modules, but I have never used Select Batch and TransferBatch. I just ran a quick test in B/M and although the return codes from both methods were successful (1), nothing was moved. Maybe someone can point out something wrong or missing to consummate the transfer:
r = oSession.nSetProgram(oSession.nLookupTask("BM_Production_ui"))
Set oBMProd = oScript.NewObject("BM_Production_bus",oSession)
r = oBMProd.nSelectBatch("11111")
r = oBMProd.nTransferBatch("99999","0000004")
r = oBMProd.DropObject
Set oBMProd = Nothing
------------------------------
Dan Burleson
Software Consultant
Connex Software
Corvallis OR
541-829-1054
------------------------------
Original Message:
Sent: 05-15-2026 00:54
From: Alnoor Cassim
Subject: Sales Order Invoice Automation functionality
Joe - Yes. That type of project is BOI conducive as an external script or app. I'm thinking @Dan Burleson has done some equivalent of this before among a few others. I've only done it for PM Transaction Register print and update. If Paperless is setup correctly, this script / app should be able to:
- Scan through all the batches and ID the invoices that don't meet the margin criteria, then use the Transfer Batch feature (via code) to transfer them to a given batch number. The next morning someone may have to manage / disposition that batch.
- Loop through the now scrubbed batches to print invoices (hopefully they are all set for electronic delivery), print the daily sales reports and sales journal, then update the journal. (I'm not sure if all batches can be selected in code all at once like you can in the UI, so it might have to be one at a time, but still it would get the job done unattended)
- Capture errors in a logfile and email those out
- Be scheduled with Windows Task Scheduler to run unattended
------------------------------
Alnoor Cassim
Accounting Systems, Inc. (ASI)
------------------------------
Original Message:
Sent: 05-14-2026 23:28
From: Calvin Morrison
Subject: Sales Order Invoice Automation functionality
I don't know the answer but I am also interested in how to post batches or run registers programatically or on a schedule, so not to derail but if anyone knows about that as well!