Scripting, Introduction – Kofax DOKuStar Validation User Manual
Page 34
![background image](/manuals/658312/34/background.png)
DOKuStar Validation Programming Manual
Page
• 30
Scripting
Introduction
Scripting is the process where you add additional pieces of code to meet project-specific requirements. Scripting
routines are preferably written in the built-in VBA studio, but could also be placed in the external Development
Studio, if you use the COM interface.
Scripting routines always come together with events: The routine shall be executed, when a certain event took place.
For example: The validation operator entered something to a field. This leads to a
Field Changing
event, and a
scripting routine could be executed to validate what was typed in.
Let us look at a simple example:
Suppose a document type
Invoice
has been defined in the Schema, which has a field
TotalAmount
.
Whenever the user changes this
TotalAmount
field, the field shall be checked if the value is greater than
1000.00; if so, the user shall confirm the change in a message box.
Before we start writing code, we need a project file that defines at least this document type and the field. The easiest
way is to create it manually.
Afterwards, start DOKuStar Validation in administrator mode and open this project file. Press the VBA studio
button:
In the VBA studio, a tree view in the left window with a root node named
Project
can be seen. Expand this node
up to the
TheApplication
node, and then double click. This will open the editing window, where you can add
your code, as described in the following chapters.