T4W_Classes – “The Brain of TIER”
Overview
The T4W_Classes table in the TIER database performs important functions in terms of looking up and inserting data for T4W tables.
Details
“T4W” stands for TIER for Windows. There are many “T4W” tables that make up a TIER database – T4W_Documents, T4W_Forms and T4W_Users just to name a few.
T4W_Classes table
T4W_Classes is a small table in size compared to many other tables in a TIER® database. There are only 5 data columns and approximately 40 rows depending on the various components used.
T4W_Classes has two main purposes:
- It tells the user what T4W table to query to look up the data.
- It controls the next value used when inserting data into the T4W table specified.
To query data, the first two columns of this table are used:
- The first column, OP__ID is an identity column. This column is referenced as the op__parentclass in other T4W tables.
- The second column, OP__ClassClassName is the table identifier. TTier tells us it’s a TIER T4W table and the rest of the name tells which T4W table to use. For example, when looking at a specific row in T4W_Documents, the op__parentid and op__parentclass are referenced. If the op__parentclass is 6 and the op__parentid is 124, go to T4W_Classes to find out what the class is for op__id 6, which is TTierCabinets. Then go to T4W_Cabinets to find the data for op__id 124.
To insert new data into TIER, the third column of T4W_Classes is used:
- OP__LastID tells us the last number used in a specific T4W table. When inserting a brand new row of data, the next number will be used as the OP__ID. For example, if we were creating a new cabinet, we would look at op__classclassname for TTierCabinets. Then, op__lastid would indicate that the last op__id used in T4W_Cabinets is 201, so when inserting a new row, 202 would be the op__id used.
The TIER executable was written to handle both querying data and inserting new data on its own. For developers trying to replace the role of the executable with code, it’s important to keep T4W_Classes – “the brain of TIER” in mind when making these changes. Failure to update the op__lastid column or inserting the data into the wrong T4W table could cause “the brain” to short circuit.
See the attached pdf for the entire Tidbit and accompanying screen shots.
