PostImportBatch

The Runtime Server triggers this event after it finishes importing the batch. Use this event to set batch properties such as batch name and external group ID.

Syntax

ScriptModule_PostImportBatch( ByVal BatchDatabaseID as Long, BatchName as String, Priority as Long, State as Long, ExternalGroupID as Long, ExternalBatchID as String, TransactionID as Long, TransactionType as Long)
Parameter Description
BatchDatabaseID

The unique Batch ID from the database that corresponds to the numeric BatchID within the associated database tables.

Note: You cannot change this read-only parameter.
BatchName The Batch Name assigned by the Runtime Server instance. The name comes from the Import settings of the Runtime Server instance.

You can change this read or write parameter to any string value.

Priority The Batch priority assigned by the Runtime Server instance. The priority comes from the Import settings of the Runtime Server instance.

You can change this read or write parameter to any long value between 1 and 9.

State The Batch State assigned by the Runtime Server instance. The status comes from the Import Success workflow setting in the Runtime Server instance.

You can change this read or write parameter to any long value between 100 and 999.

ExternalGroupID The Group ID assigned to a batch.

The Group ID used with the new scripting security methods that enable the developer to assign a batch to a security group. Only those users belonging to the same Group ID are able to access batches.

For example, a batch belonging to Group ID 80 is only accessible by another user assigned to group 80.

You can change this read or write parameter to any numeric value.

ExternalBatchID The External Batch ID assigned to a batch.

The External Batch ID allows the developer to synchronize a newly created batch of documents with another external system. For example, a storage box ID.

You can change this read or write parameter to any numeric value.

TransactionID The Transaction ID assigned to a batch.

The Transaction ID allows the developer to synchronize a newly created batch of documents with another external system in order to identify originators of a batch of documents.

You can change this read or write parameter to any long value.

TransactionType The Transaction Type assigned to a batch.

The Transaction Type allows the developer to synchronize a newly created batch of documents with another external system. It identifies the types of documents (Invoices, Claim forms etc.) in batches or the source of a document, such as Email or Scanned.

You can change this read or write parameter to any long value.

Sample Code

The following sample code updates the batch priorities after the import has been done. It changes the name, state and adds a group ID as well as a transaction type and an ID.

Private Sub ScriptModule_PostImportBatch(ByVal BatchDatabaseID as Long, BatchName as String, Priority as Long, State as Long, ExternalGroupID as Long, ExternalBatchID as String, TransactionID as Long, TransactionType as Long)
   'Set batch priorities after import
   BatchName = "AP Batch_" & CStr(BatchDatabaseID)
   Priority = 2
   State = 102
   ExternalGroupID = 777
   TransactionType = 10
   TransactionID = 2
End Sub

See also