ChronoScan Capture Pro User guide 2013

Table of Contents

ChronoScan Capture Applications .........................................................................................................4 Technical Support .............................................................................................................................5 How To's & Video Tutorials..............................................................................................................6 Extracting data from PDF files to CSV/XLS ..............................................................................7 Data capture from invoices ......................................................................................................10 Fast Field definition mode .......................................................................................................11 Complex PDF report data extraction tutorial ...........................................................................12 Direct database lookup ............................................................................................................13 Document split using IDR ........................................................................................................14 ChronoScan Main Concepts ..........................................................................................................15 OCR/ICR – Optical Character Recognition .............................................................................16 Barcodes & Patch Codes ........................................................................................................17 Jobs ..........................................................................................................................................19 Batches .....................................................................................................................................21 Inputs ........................................................................................................................................22 Outputs .....................................................................................................................................24 Documents ...............................................................................................................................25 Document Type ........................................................................................................................27 Automatic Learning Document Types & Zones .......................................................................28 Data Fields ...............................................................................................................................30 OCR Zone ................................................................................................................................32 OCR Triggers ...........................................................................................................................34 OCR Trigger Properties .....................................................................................................36 Capture Grid .............................................................................................................................38 Scanning & Importing Images .......................................................................................................40 Job & Batch Creation ..............................................................................................................41 Scanning From Twain Scanners ..............................................................................................48 Import Files Module window ....................................................................................................50 Barcode Reading .....................................................................................................................52 Document split using barcodes or PatchCodes ......................................................................55 Processing Batches .......................................................................................................................56 Exporting Batches ..........................................................................................................................57 Configure Image & Data Output ..............................................................................................58 Conversion Modules Reference...............................................................................................61 Export Modules Reference ......................................................................................................62 CMIS Alfresco Export Module ...........................................................................................63 Using ChronoScan .........................................................................................................................68 Batches Panel ..........................................................................................................................69 Scripting Model ..............................................................................................................................71 Objects .....................................................................................................................................72 ChronoApp .........................................................................................................................73 UserField ............................................................................................................................79 DocType .............................................................................................................................82 ChronoBatch.......................................................................................................................84 Scripting - Sample VBScripts ..................................................................................................89 Lookup Fields from an external database using scripts ....................................................90 Filling a help list from an external database .....................................................................92 Set default field values for detected Document Types ......................................................93 Running a vbs script in daemon mode..............................................................................94 Validating a field using an external database ....................................................................95

Executing ChronoScan on CommandLine...............................................................................96 Using command line parameters on VBScript...................................................................98 ChronoScan Personalization ..........................................................................................................99 Keyboard Accelerators Cheat Table ............................................................................................105

ChronoScan Capture Applications

ChronoScan Capture allows you to configure advanced applications for document scanning and data capture. • Multiple OCR engines • Advanced user interface. • Automatic learning of user actions for generating templates for different document types. The ChronoScan team thanks you for trying or using ChronoScan. Our main goal is to create the best Scanner Control & Data Input solution in the world and make it accessible to everybody that needs to input data on a regular basis. Feel free to contact us with any question or suggestion regarding [email protected]. All e-mails are human processed, and you can talk directly with the Development team to ask questions or make suggestions.

Technical Support

There is a support forum open and free to everybody, here you can ask or find specific questions, not only related to ChronoScan but also about image processing, scanning or data input. Registered users also receive a direct support e-mail to ask questions to the development team. ChronoScan Support Forum

How To's & Video Tutorials This section contains How To articles and videos. Also, there is a YouTube channel with videos showing how to use the ChronoScan Forum. Visit it on ChronoScan Youtube Channel

Extracting data from PDF files to CSV/XLS In this sample video we will show you how to configure ChronoScan to dismount PDF files to a compressible data file (CSV/XLS). This is our sample document, Text PDF files with multiple pages. We want to extract some fields and all the details lines.

For every processed document we want to get a csv file named with the Inv.No: 106673N.csv And with the detail lines: "Invoice Date","Line No","Location","Part Number","Description","Description_PartNumber","Ordered","B.O.","Supplied","Unit List","Unit Net","GST Code","Total"

"23/10/2013","1","SS03EA","CP-TLB-35400G","SNORKEL CAP 1HZ L/C DSL 1/92-1/ 07 PLAST","1773066010","1","","1","191.81","67.13","10.00%","67.13" "23/10/2013","2","RD09AA","CP-TLG-80010RHG","RH F/D VDJ79 L/C UTE 1/07- ST D","67001-60650","1","","1","1859.11","743.64","10.00%","743.64" "23/10/2013","3","RD01AA","CP-TLG-80010LHG","LH F/D VDJ79 L/C UTE 1/07- ST D","67002-60650","1","","1","1859.11","929.55","10.00%","929.55" "23/10/2013","4","RB05AA","CP-TLG-80011LHG","LH F/D VDJ79 L/C UTE 1/07- GX L","6700260660","1","","1","1859.11","743.64","10.00%","743.64" "23/10/2013","5","RC12AA","CP-TLG-80011RHG","RH F/D VDJ79 L/C UTE 1/07- GX L","6700160660","1","","1","1859.11","929.55","10.00%","929.55" ........

Inv No We are going to use Inv No. to generate the output csv file name. Date

We want the invoice date on all the extracted lines Grid Module

You will learn how to configure the grid module for details line capture on multiple pages. Custom column processing We will create a custom column to extract data from a multi-line column Split page rows

You will see how split rows are managed on ChronoScan Video Tutorial:

------------------------

Data capture from invoices In this video you will see how to configure a multiple invoice type application:

Fast Field definition mode In this video you will see how to create fields using fast creation mode (F9)

Fast creation mode allows you to select the new field name from the OCR text, and create then, the zone.

Complex PDF report data extraction tutorial This video tutorial shows how to extract data from a complex report in PDF format, it uses 3 capture grids.

Direct database lookup A short tutorial of how to configure direct database lookup.

Document split using IDR This video shows how to split documents using IDR (Intelligent document recognition).

ChronoScan Main Concepts Here you will find a short description of the main concepts of ChronoScan Capture.

OCR/ICR – Optical Character Recognition Optical character recognition, usually abbreviated to OCR, is the mechanical or electronic conversion of scanned images of handwritten, typewritten, or printed text into machine-encoded text. (Wikipedia). In computer science, intelligent character recognition (ICR) is an advanced optical character recognition (OCR) or, more specifically, a handwriting recognition system that allows fonts and different styles of handwriting to be learned by a computer during processing to improve accuracy and recognition levels. (Wikipedia) NOTE: Keep in mind that OCR/ICR doesn't substitute human revision of critical data. Use it as a tool to speed up your data entry process.

Barcodes & Patch Codes

A barcode is an optical machine-readable representation of data relating to the object to which it is attached. (Wikipedia). Barcodes are optimized to be safe and quickly readable, use it whenever you can to read the data stored on it. Patch Codes are a type of Barcode that are commonly used to send commands to the program, such as end of document, number of pages per document, or scan depth change. Which will use PatchCodes to set data for the documents scanned after it (for example set document type or other fields to a value).

Read Barcodes from images

Read barcodes of any type Process Captured Data Set barcode read to input fields, you can validate or split the barcode in multiples fields or even check it with an external database.

Jobs A Job in ChronoScan is a set of settings that refer to a specific set of documents that share input data fields, scan settings, and final store destination. Good samples are Received Invoices, delivery notes from the supplier… Document Fields for an example Barcode Job:

Jobs also contain Batches (groups of scanned/imported documents):

And Document Types (Templates):

Batches A Batch is a particular instance of a Job, (for example January Invoices, February Invoices and so on) that belong to a received invoice Job. The job/batch structure is the most used in data entry and scan programs to improve performance and minimize system configuration. Job AIRBUS contains seven Batches:

Inputs In ChronoScan, an Input refers to an input module that adds Images or data to a particular Batch. The standard inputs are: Import Images, import images from disk files:

Import PDF: import PDF files even if they are text based PDF’s (not images):

TWAIN Scanner: scan images from any TWAIN compatible scanner or camera.

Image Generator: a simple image generator for training/test porpoises.

Outputs An output refers to the final destination of the images and data created with ChronoScan, in ChronoScan you define an Output as the format of the exported items plus its final destination (storage). For example: “TIFF files stored to local disk”, “PDF files stored to SharePoint Server”, “XML file stored in a FTP server”. ChronoScan can produce more than one output at the same time when you export a Batch. You can also use the captured data to generate file names or directory structures or export it to XML,CSV, ODBC, and other data formats.

Output Converter to PDF Text

Convert documents to PDF Text Output Converter to PDF Tiff

Convert images to Tiff files Send converted input (PDFText) to FTP

Gets the documents from the source module (PDF Text) and sends them to FTP Send converted input (PDF Text) to local disk

Copy converted PDF documents to local disk.

Documents

Documents are a basic structure in ChronoScan, defined as a set of images and input data plus an arbitrary number of Data Fields defined by the user.

Documents may or may not have a Document Type assigned - assign a Document Type to a document if you want ChronoScan to remember OCR zones from it. OCR Zones for Capture Fields

Extract data from documents to fields using OCR Zones.

Grid OCR Control

Extract line details for documents with the Grid OCR Control

Document Type Document Type refers to a “Kind of Document”. The kind of document is determined by physical similarities found in those documents. This is done manually, by computer vision algorithms, or OCR triggers. Document type will always save its information in the "Collaboration document type" field of the Job. If you want to automatically recognize types, ensure that you always have one "Collaboration document type" field.

Automatic Learning Document Types & Zones ChronoScan includes the capability of learn the Document Type based on layout recognition features. This advanced feature allows it to “remember” user actions about this kind of documents, allowing the user to automate repetitive tasks and improve data input. Every different document type will be assigned to a different template to customize OCR areas and settings.

Documents recognized as "Document Type 1"

Documents recognized as Type 1 will use Document Type 1 Documents recognized as "Document Type 2"

Documents recognized as Type 2 will use Document Type 2

Data Fields

Data Fields allows the user to assign values to a Document, the data fields can be text, lists, and numbers, amounts or dates. The user can manually enter data on Data Fields, assign a default value or read it from OCR Zones or Barcodes.

Data Fields and its values

You can have any number of data fields on ChronoScan. Data field properties

Allows you to set properties for the data field. You can set data type, set input mask, sticky values and even program VBScripts to extend ChronoScan capabilities.

OCR Zone

The OCR Zone is a defined area on a page of a document of known Type; OCR Zones can be Text, Numbers, amounts, or dates. The data extracted from an OCR Zone can be assigned to a Data Field of the Document

OCR Zone in ChronoScan

Fast Menu for OCR Zone (Right Click)

You can set up OCR Zone basic properties with the context menu, click on Advanced properties to see advanced options for the Zone:

OCR Triggers

The OCR Trigger is an action associated with an existing text or regular expression on the document. Actions for triggers are: • • • •

Split document on Page 1 or last page. Set Document type based on a text. Link OCR Zones to floating text positions. Search fields on multiple pages.

OCR Trigger and its result and action

In this case the trigger is positive (TRUE) Position Link created by the trigger

Trigger search something similar to "Invoice No." and create a position reference for OCR Zones. When you reference OCR zones to a floating trigger you will see link arrows indicating the position reference:

OCR Trigger Properties

Main Trigger Properties Local OCR The trigger can work with the Background/Full Page OCR if it exists, in some cases it is better to set OCR local to make OCR only in the zone of the trigger. This will speed up jobs where you need to capture fields from documents but don't need the full page OCR. Trigger Conditions

This allows you to control the trigger activation. You can include some words or regular expressions to search, when the text or regexp is found, the trigger is activated. You can include different strings/regexp on the same trigger using a semicolon (;) as string separator (ex: NR. 4;NR. 5) Fuzzines mean the error margin you allow for the searched text, 0, means that the strings must be equal, > 0 is fuzzines force, more fuzzines allows more differences on the comparasion.

Trigger actions

This allows you to set the actions for the trigger. You can also set the document type for the document if the trigger is positive. Main actions are: • • • • • •

Split Document (this is first page) Split Document (this is last page) Create a position reference for OCR zones Execute a VBScript Horizontal reference line, (used on grid capture for upper/lower table limits) Report Splitter (Use on grid capture for multipage-record management)

Trigger options

• • • • •

Name: name of the trigger Show on page: set in with pages the trigger is executed. Execute on Type: allows you to control only if you want this trigger to run on the specified type. Run on type: works when previous option is set to Execute only on type. Execute only if this trigger is positive: allows you to link trigger execution with the result of another trigger. • Trigger Logic: allows you to reverse the trigger logic (ensure that one text doesn't exist) • OCR Local: View point One

Capture Grid

The grid allows to capture and index data from tables. Capture Columns Use the grid head to configure the dfferent columns on the grid Capture Rows

Rows on the grid

Grid Menu

Allows to move and set options of the Grid, basic options are: • In with pages the grid is used • Triggers to start/end grid • Grid limits

Scanning & Importing Images

Job & Batch Creation

1. -The first thing you need to start scanning or import images is to create a batch of a determined Job type. If you don't have any Job type defined, use the Job Wizard to create a new one. Let's look step by step:

2.- On the New Batch Window use the Job Wizard to create a new Job Type:

3.- Insert a Job name that describes the type of job you want to do:

4.- Select the main options for the Job. If you want to read barcodes from your documents, activate Barcode Reading: to define OCR zones, activate detect document type.

To select basic options for document split, ChronoScan needs to know where the documents end, the basic options are: • Single Image Documents If your documents are one single image, click on this button. Every image added to ChronoScan will be a Document. • Multi-Image Documents If your documents have more than one image, click here and select one of these options: • Split manually All the pages scanned are inserted into a unique document; you will split the documents later on the ChronoScan viewer. • Split each 'x' images If your documents have all the same number of pages, select this option and you will be prompted for that number when you click 'next'. • Split when a valid Barcode is Found Every time ChronoScan reads a barcode it creates a new document; use it if the first page of your document contains a barcode. • New document On PATCHCODE found If you want to split the documents on Pathcodes, select this option. Print a couple of Patchcodes and insert them between your documents to automatically split the documents on scan.

5.- Define the fields for your Job - you can use the default fields or insert your own - thses fields allow you to associate data to every one of your documents and use it to be exported, name the files, and set metadata/ bookmarks on PDF files.

6.- Finally, define which kind of file format and file destination you want for your documents:

Now you have a Job Type to start to scan and process images, when you click 'finish', you will see the active “Create Batch” button. Click on it to create a new Batch with the name you desire. You can create all the Batches you want with the same Job configuration:

Scanning From Twain Scanners

Start Scan button

Start to capture images from the selected scanner.

Setup Scanner button

Allows you to configure the selected scanner

Select Source button

Used to change the twain source (active scanner)

Always Create New Document at Start Scanning button Allows you to create a new document every time you start a new scan. Transfer Mode

• Native mode is a very compatible mode. • File mode is a faster twain mode, but will not work with some scanners

Import Files Module window

Import configuration

Input configurations can be saved with different names, and allow you to configure your input options. Import: "tiff images import" button

Click on Import to start importing images to ChronoScan Explore: c:\temp\ button

This button will open a file explorer on the current input directory.

Barcode Reading

ChronoScan allows you to capture barcodes from the imported images. Click on "Barcode Read"->"Activate barcode read" to set up basic barcode options.

Barcode Type and length

Select the barcode types you want to read and set the length of the barcode Sample read barcode

Show the value and the read barcode type Image processing allows you to optimize barcode reading

Set options to improve recognition rates. Barcode Actions

Allows you to set up basic actions when you find a barcode. Read area

Allows you to set a custom read area for the barcode

Document split using barcodes or PatchCodes

You can use PatchCodes or Barcodes to split your documents. Keep in mind that PatchCode and barcode splitters are deleted after read. If you want to preserve the splitter image use "Barcode Read" options instead of Document Split. A PatchCode is a page with an optimized barcode that allows you to split your documents or execute actions while scanning:

Usually, you will print a big set of PatchCodes and insert them between your pages to tell ChronoScan where the different documents start. Also you can use a custom barcode with a specific value to act as a document separator.

Processing Batches This section will cover all the processing topics.

Exporting Batches Exporting Batches is the process of converting and sending the documents and data on ChronoScan to its output destination.

Conversion Module This kind of module converts images or data to a specific file Format. For example, you can scan tiff images, but you want to generate PDF text files. Export Module

Get the result of an Output Converter and send it to a specific destination such as disk files, Sharepoint Server or Cloud Server (Google docs, Dropbox…)

Configure Image & Data Output

When you finish scanning or processing your Batch , you want to get the result. This is done through the Export Batch button on the main ribbon, or in the small CD on the Batches Panel:

When you click Export Batch on the ribbon, you will see the Execute output window. In this window you can configure ChronoScan to produce your desired output. You can link any number of modules to get your results. For example, you can create a configuration that converts to TIFF and PDF and sends the TIFF to Alfresco, and the PDF to GDrive and local disk.

Ouput is managed with two kind of modules:

Conversion Modules: Convert your batch images and data to a determined format. Typical formats are: For images and OCR: 1. 2. 3. 4. 5.

Pdf with Searchable Text Pdf Jpeg Tiff images ...

For data: 1. XML Format 2. TXT or CSV Format 3. Send data to external database (through ODBC) Keep in mind that you can add specific configuration for every conversion in the export. For example, you can export your images to PDF with two different resolutions.

Output Modules: Get the result of the conversion module and send it to a final destination. Typical final destinations are: 1. 2. 3. 4. 5. 6.

FTP Local or network hard drives Sharepoint (tm) Alfresco CMIS Servers Google Drive Add a conversion and output module

This option will show a wizard that allows you to select a conversion format plus an output module and add both to the current configuration. Link a conversion or output module to the selected module

This option allows you to link a conversion or an output module to the selected module.. Modules in the Job output

Here you can select the modules on the Output configuration. When a module is selected the modules panel shows its preview and options.

Save button

Allows you to manually save changes made to the output configuration.

Conversion Modules Reference This section includes reference for any of the conversion modules.

Export Modules Reference This section includes reference for any of the export modules.

CMIS Alfresco Export Module

CMIS Module allows ChronoScan to export processed files and metadata to any CMIS compatible server, like Alfresco or FileNet, for a complete list of CMIS compatible modules see: CMIS Servers (Wikipedia) The CMIS module configuration is availaible on the Execute output utility:

CMIS Connect Information

Set the URL of your CMIS repository and your connection credentials.

Server Explore

Allows you to check the connection to the CMIS / Alfresco server and select the main output folder. Document destination

This section allows you to set the final document/records destination. ChronoScan will try to create the full Path if it doesn't exist. You can nest all the levels you want. Select the variables you want to use to generate the destination of your documents. You can also set the type of uploaded documents with Set ObjectTypeId. Make sure to use a valid ID type using the CMIS Workbench.

Metadata asignment

This section allows you to set the metadata of the uploaded document, add all aspects/properties you want, and assign the values using the variables Wizard (Click on the ... button that appears when you edit one of the fields).

Use the Add Property/Aspect buttons to add new items. Note for Alfresco users: If you are going to upload metadata in another format than text, you should use the type cast qualifier on ChronoScan, the types that need cast are: • • • •

date int long decimal

To use the cast qualifier, write the data type before the value plus with a colon ":" Example: dynamic:property16

date:%docfield.Capture Date%

CMIS Workbench We recommend the Apache Chemistry (TM) CMIS Workbench to explore your CMIS server, with the CMIS workbench you can view your document types, properties and aspects as they are exposed to CMIS. Apache Chemistry download page Login Page:

CMIS Workbench application:

This topic will cover user interface help

Using ChronoScan

Batches Panel

The Batches panel allows you to view all your Batches and their status with an bird's eye view. It also allows you to execute operations in selected batches at the same time. Click on the column's name to sort by specific column. Use Ctrl+Click to select more than one batch. Batches Toolbar From Left to Right: • • • •

Open Batch Process selected batches Export selected batches Delete selected batches

Batches Columns From Left to Right: • • • • • • • • •

Batch status when in process. Job: name of the Job for the Batch. Batch: batch name. Modified: last modified date of the Batch. Number or images of the Batch. Number of documents in the Batch. Number of errors in the batch. A green check mark when processed OK or a warning on process errors. A green check mark when exported OK.

Selected Batch Summary

Shows the batch summary Export Reports

Click on the magnifier to view details of the executed export and review the output.

Scripting Model This section includes the documentation for all the available Objects for the VBScripting of ChronoScan.

Objects Scripting Objects

ChronoApp Allows you to access to the ChronoScan application object. Methods: Returns Description Method Parameters: String GetVariableValue String variable Requested variable to ChronoScan, for example "station_id" You can see a complete variable list in the variables wizard window of ChronoScan. Return value for the selected variable. Parameters: void AddToOutputWindow String value Add the string to the ChronoScan trace window.

ADO.Connection Parameters: CreateAdoDBConnection connectString ADODB String connection. Take a look at this good article by Carlos Antollini to configure your DSN. usrId, optional username if you don't set it on your DSN usrPwd, optional password if you don't set it on your DSN. Returns a connection to a database, ChronoScan will maintain

this database open for you, don't call mydb.Close Parameters: ADO.Connection GetChronoScanDBConnection name Name of the database connection on the ChronoScan database manager. usrId, optional username if you don't set it on your DSN usrPwd, optional password if you don't set it on your DSN. Returns a connection to a database, ChronoScan

will maintain this database open for you, don't call mydb.Close Create ChronoBatch CreateBatch a new Batch: String JobName String BatchName or blank to use default name If batch name already exist it is returned. Parameters: String cmdline_GetValue String KeyName, the name of the key to be retrieved Returns the value of the command line key.

Ex: ChronoScan.Exe vbs:"testscript.vbs" mykey:"c: \myprocdir" ChronoApp.AddToOutputWindow "My process dir is " & ChronoApp.cmdline_GetValue("mykey")

SHORT Parameters: cmdline_HasKey String KeyName, the name of the key to be check Returns 1 if the key exist on the command line, or 0 elsewhere. SHORT Parameters: cmdline_HasVal String KeyName, the name of the

key to be check Returns 1 if the key exist and has value on the command line, or 0 elsewhere.

UserField You will receive one UserField object for every user field in your job when personalizing document Scripts. Properties: Type Description Method Allows Value String you to set the user field value Set ValidateStatus bool it to 1 or 0: •



1 means that the value of this field is correct 0 means that the value of this field is incorrect Keep in mind that script validation overrides normal app validation rules.

void Message ValidateMessage to show to the user when the value of the field is incorrect.

Methods: Returns Description Method Force Validate short the document to "revalidate", for example for calculated fields. Parameters: SetDefaultValue void String value New default value for the field. Parameters: HelpList_AddValue short String Value to add to the list

Return value index

DocType You will receive one DocType on your script when personalizing document Scripts. Methods: Type Description Method Parameters RenameType void newname The new name for the type Rename the current type. Parameters SetFieldDefaultValueForType void fieldname Name of the field value Value for the field when this type is set. Set default field value for this type. Thses values will be set when the Document

Type is assigned or manually set to a document.

ChronoBatch Allows you to access to the ChronoScan application object. Methods: Returns Description Method long Parameters: GetDocCount Return String GetName Batch Name String Return GetJobName Job Name Short Parameters: ExecuteInputModule modname: •



image_files (import image files) pdf_files (import PDF files with text extraction and image conversion) modparams:



ConfigName#parameter=value#parameter=value

Allowed parameters of pdf_files module: •



directory = c: \temp extensions = *.pdf





• •











| onlythisfile.pdf | *.pdf;*.pdfx finddirs = true| false textread = true| false pagestoextract = extracmode = 0 (images) | 1 (convert to image) resolution = 96| 120| 150| 200| 300| 400| 600 colortype = 0 (black and white) | 1 (color) splitonfile = true| false splitondir = true| false orientateauto = true| false



• •





deleteonimport = true| false renameimportfile = sav movetofolder = or < \process_folder> for_fast_text_processing = 1 (speed up text extraction, warning: setting this parameter to 1 means that image quality will be lower) debug = 1 (allows to view the import options before import)

Allowed parameters of image_files module:



• • •









• •



directory = c: \temp filename = * extension = * finddirs = true| false splitonfile = true| false splitondir = true| false importfromlastfile = true| false deleteonimport = true| false renameimportfile = sav movetofolder = or < \process_folder> debug = 1 (allows to view the import options before import)

Parameters: Short ExecuteProcess operations: • • • • • • • • • • •

CROP DESKEW OCR PRETRIGGERS TYPEDETECT FIELDREAD XGRIDREAD EXPORTBATCH BEEP SENDMAIL Use ; to execute more than one operation at once (ex: DESKEW;OCR) If empty will use the configured options on the Batch. Short Save Save Changes on the Batch Short Empty DeleteAllDocuments the Batch

Scripting - Sample VBScripts Here you will find sample VBScripts to personalize ChronoScan standard behavior.

Lookup Fields from an external database using scripts

This sample will search the Document_Type on an external database and lookup 2 fields, if the value doesn't exist it will set the field to error status.

Right Click with the mouse on the field and click on "Advanced properties"

Set the script for the OnValueChanged event

Dim SQLString ' Create a database connection, Set MyDB = ChronoApp.CreateAdoDBConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C: \Dbs\suppliers.mdb;Persist Security Info=False;", "", "")

' Build your SQL Query SQLString = "Select * from Suppliers where SupplierName = '" & UserField_Document_Type.value & "'" Set rsCustomers = MyDB.Execute(SQLString) If Not rsCustomers.EOF Then ' Action when the searched value exist UserField_AccountRef.value = rsCustomers.Fields("AccountRef") UserField_NominalCode.value = rsCustomers.Fields("NominalCode") UserField_TaxCode.value = rsCustomers.Fields("TaxCode")

Else

' Validate the Fields UserField_Document_Type.ValidateStatus = 1 UserField_AccountRef.ValidateStatus = 1

' Set field validation to error UserField_Document_Type.ValidateStatus = 0 UserField_AccountRef.ValidateStatus = 0 UserField_AccountRef.ValidateMessage = "Supplier doesn't exist On the remote database" End If

Filling a help list from an external database This sample script shows how to fill a helplist on ChronoScan using an external dabase: Dim SQLString Set MyDB = ChronoApp.CreateAdoDBConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\my_dbs\suppliers.mdb;Persist Security Info=False;", "", "") SQLString = "Select * from Suppliers Order By SupplierName" Set rsCustomers = MyDB.Execute(SQLString) UserField_Document_Type.HelpList_Clear() Do While Not rsCustomers.EOF UserField_Document_Type.HelpList_AddValue( rsCustomers.Fields("SupplierName") ) rsCustomers.MoveNext

Loop

UserField_Document_Type.HelpList_Populate()

Set default field values for detected Document Types This sample script allows you to set a default value for your fields when a Document Type is assigned or detected. Dim SQLString ' Connect to the database Set MyDB = ChronoApp.CreateAdoDBConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Dbs\suppliers.mdb;Persist Security Info=False;","","") SQLString = "Select * from Suppliers where AccountRef = '" & UserField_Document_Type.value & "'" ' Search a value based on the document type Set rsCustomers = MyDB.Execute(SQLString) If Not rsCustomers.EOF Then UserField_AccountRef.value = rsCustomers.Fields("NominalCode") ' This will set a new default value for the field AccountRef for the current Document Type. Call DocumentType.SetFieldDefaultValueForType("AccountRef",UserField_AccountRef.value) End If

Running a vbs script in daemon mode This example shows how to setup an vbs script to run some code in an infinite loop: Define this helper function on your VBS, this trick command ensure you a minimal cpu usage while sleeping: Sub subSleep(strSeconds) ' subSleep(2) Dim objShell Dim strCmd If strSeconds