Getting Started with TRANSACT (32247-90007)

152 Chapter9
Creating Custom Applications
Finally, a localizable application should allow logic to be added to handle such things as:
special field edits for any of the transaction’s data elements, data calculations, etc. With
this brief background, let’s look at how Transact can achieve this level of localization. Our
objective is to write an application program such that if we choose to change the
application as described above, we need not modify the program. We only need to record
the changes in the dictionary, recompile the program to make the changes known to it,
modify our VPLUS forms file to reflect the changes, and possibly unload and reload the
database, if its structure has been modified.
We will start with a simple transaction that only applies to one dataset. This will
demonstrate all of the concepts we want to achieve through localization. Later we will
extend this example to include a transaction that applies to several datasets, in order to
demonstrate the general case of how to write generic code.
Let’s use the customer dataset of our example database for illustration. Our generic
transaction provides the capability to update information for a customer. Breaking this
application into the two parts discussed above, the critical element in this transaction is
cust-no. The noncritical elements are: name, street-addr, city-state, and zip-code.
The VPLUS form used for each of these functions is vcustomer.
Figure 9-1. VPLUS Form to Maintain a Dataset
The dataset definition looks like this:
vcustomer customer data
number [ ]
name [ ]
address [ ]
city,state [ ]
zipcode [ ]