Using Custom Fields

TIMS3 is installed with 10 predefined custom fields. For easy startup using custom fields all you need do is turn on the use of these fields using the 'Used' checkbox in the figure below. More fields than 10 are also possible but, it requires you to have Database Administrator privilege and sufficient knowledge about how to manipulate your backend RDBMS engine, see 'Unlimited Custom Fields' below. Data for this form is stored in the TIMS3 database table named tblUserFlds.

Custom Field Maintenance

Field Descriptions

The custom field description indicates the name that will be displayed for the custom field on the form in Project Navigator and Data Manager. The default field description and predefined field names indicate the type of data that can be stored in each field.

Pre-defined Custom Field Definitions

 

Field Name

Data Type

Size

Indexed

 

UserIndex01

Text

20

Yes

 

UserIndex02

Text

20

Yes

 

UserIndex03

Text

20

Yes

 

UserLong01

Long Integer (-2147483647 to +2147483648)

4

No

 

UserLong02

Long Integer (-2147483647 to +2147483648)

4

No

 

UserText01

Text

30

No

 

UserText02

Text

30

No

 

UserText03

Text

30

No

 

UserText04

Text

30

No

 

UserText05

Text

30

No

 

Format String

This is the Visual Basic field format property to describe how the data is formatted for display. Note these are display properties only and do not affect the actual input value. Some possible values include:

For a full range of options see the Visual Basic Format() function and some sample VB code below:

MyStr = Format(Time, "Long Time")
MyStr = Format(Date, "Long Date")
MyStr = Format(MyTime, "h:m:s") ' Returns "17:4:23".
MyStr = Format(MyTime, "hh:mm:ss AMPM") ' Returns "05:04:23 PM".
MyStr = Format(MyDate, "dddd, mmm d yyyy") ' Returns "Wednesday, Jan 27 1993".
' If format is not supplied, a string is returned.
MyStr = Format(23) ' Returns "23".
' User-defined formats.
MyStr = Format(5459.4, "##,##0.00") ' Returns "5,459.40".
MyStr = Format(334.9, "###0.00") ' Returns "334.90".
MyStr = Format(5, "0.00%") ' Returns "500.00%".
MyStr = Format("HELLO", "<") ' Returns "hello".
MyStr = Format("This is it", ">") ' Returns "THIS IS IT".

Field Control Types

Custom Field data can be displayed using a variety of different control types.

Field Validation Codes

A Validation code is written using a rudimentary language that tells TIMS3 how a custom field should be processed.   Ways to process a custom field may include:

The codes are written in the form: "@|key1([value1]) @|key2([value2]) @|key3([value3]) etc&ldots;" Keywords are marked with the pair of characters "@|" and are followed immediately by the keyword, which is in turn followed immediately by the value parameter, which is embedded between "([" and "])". The order of the keywords is not important, but note that they are processed in the order in which they appear. This means that if an earlier keyword modifies data (such as "UCASE"), later keywords will process the newly modified data - not the original data.

Available keywords and allowable values are as follows: (Keywords are not case sensitive.)

The validation code "@|UCase([y]) @|NChar([/"\])" converts the data to uppercase and disallows "/", """, and "\".

About "SQL" and "SQLOPEN" Validation Codes

Examples:

        @|SQLOPEN([SELECT Distinct Executive from tblCompanies])   with ControlType=COMBO
        @|BOOL([y])    with ControlType=CHECK

Unlimited Custom Fields

TIMS3 is capable of handling an unlimited number of custom fields, however, configuring unlimited custom fields is a task that requires Database Administrator privileges and knowledge on how to edit and manipulate database tables. If you are not sure how to manipulate database tables do not attempt to 'try something' on a live database, doing so could mean loss of data (perhaps even your life if you delete the wrong data).

In order to add additional custom fields the DBA must perform at least two operations on the TIMS3 database:

  1. First the appropriate database table needs to be modified to include the additional field name desired. The appropriate table depends on which document group the data will be associated with. Document groups include GRAPHIC, WORDPRO or SPREADSHEET. The tables associated with these groups are noted below:

    Document Group

    Table Name

    GRAPHIC

    tblGraphicDocs

    WORDPRO

    tblWordProDocs

    SPREADSHEET

    tblSpreadSheetsDocs

       

  2. After adding the field to the appropriate table, a record needs to be added to the TIMS3 database table named tblUserFlds. This data record (samples shown below) should define the TIMS3 table the field was added to in TableName, the field name in UserFldName, the displayed field decription in Descr, Used should be set to 1, TabOrder should be set to its appearance sequence number, ValidationCode, FormatString, ControlType should be filled as desribed above. Note the InputMask is not presently used and should be ignored/filled with <Null> data.

tblUserFld Data Sample