×
Menu
Index

5.5.4. Batch fields

 
A batch field is a field with one value per batch instead of one per document: the cost centre, the site, the scanning operator, a delivery date, a client code... Everything that applies to all the documents of the batch and that the operator should enter once.
Defining batch fields
Open the job configuration (Administration tab, Configure job) and use the Batch fields branch under the batch configuration, next to the document fields. A batch field has the same properties as a document field: name, description, VBScript alias, type, default value, input type (free text, list, date...), required and validation mask. Default values accept the usual variables (%station_date_system%, %chronoscan_user%, %batch_Name%...).
Where the operator sees them
Validation and export
Batch fields validate required and mask. With the job option "Prevent closing batches with errors" the batch cannot be exported while a batch field is in error, and the export report lists the fields. The values are available to the export modules and in names and paths through the variable %batchfield.Name%; the database export module and the database lookups can use them as source and as key.
Scripting
Every batch field is injected in the scripts as a BatchField_<name> object (or BatchField_<alias>) with Value, Validate, ValidateStatus and ValidateMessage, in all the job events, also those without a current document. The batch object offers GetBatchFieldValue, SetBatchFieldValue, ValidateBatchFields, GetBatchFieldCount and GetBatchFieldName; see ChronoBatch. Each batch field has its own event scripts (OnEnterEdit, OnEndEdit, OnValueChanged, OnHelpListSelect) in the VBScripts window.
In ChronoScan Enterprise the values are synchronized to the table wci_batchdata_<job> of the server database, one row per batch.