Validation Form

 

The Validation Entry/Edit Form allows you to Add, Edit or Delete Validation Methods.

The Validation Method above, named "TOMORROW," causes all fields that are associated with this rule to default to tomorrow's date based on the system clock. The Default expression is evaluated each time a user enters an empty control (no previous entry). This particular rule has no Validation Formula. The Validation Formula (if present) is run each time a control needs to be validated. The Low and High Ranges specify that the DATE (specified by the type column) must be within the range from Jan. 1st, 1900 to Dec. 30, 2020. The mask will force the mm/dd/yyyy format. Only those persons with a password level of 10 or higher will be allowed to modify the entries of this rule. The Error Message "Please enter a Valid Date in the format MM/DD/YYYY" will be displayed in a message box if the user enters a date outside of the High or Low ranges or enters a date that is not valid (e.g., February 30th). This rule has no parent rule. When a parent exists, it is evaluated first. If the parent fails the user receives the error message specified by the parent and the child is not evaluated. A parent can have a parent--there is no limit to the nesting level.

Tip: The easiest way to find the validation rule associated with a particular control is to right click on the control. Select VALIDATION from the context menu. If no validation for the column exists, you will be asked if you wish to create one. If you click YES, the define mode will be initiated for the VALIDATION FORM. After completing the rule, the CCS Program will perform the steps necessary to associate the Validation rule to the Column, and all controls associated with the Column.

Validation ID:

The Validation ID is a 20 character alphanumeric column that uniquely identifies the Method. CCS strongly recommends you use only capital letters since most ODBC drivers do not distinguish between upper and lower case characters in their indexes. Columns are associated with Validation methods via the Attributes Column in the Fields Table.

Parent ID:

When you enter an existing Validation ID in the Parent ID column, the Parent Method is evaluated first. If the Parent Method fails, the user will receive any error message specified by the parent and the child will not evaluated. A parent rule can have a parent--there is no limit to the nesting level.

Note: The default formula (see below) of the parent is not evaluated unless the child does not specify a default. Therefore, the default formula of the Child always takes precedence.

Module:

When you start a CCS Module (GL, Training, Payroll etc.), the CCS Program checks the Validation table to see if it is empty. If so, the Validation_Custom.ini and Validation.ini files are read and imported to create the VALIDATION table in the CCSCNTRL datasource.

Note: All methods in the validation table are available to all modules. This column is used to control the import and export logic only.

Note: If you drop the validation table in the CCSCNTRL datasource, the validation_custom.ini and validation.ini file will be re-read the next time any CCS Module is started, and the validation table will be repopulated. All methods in both ini files are imported regardless of the module. If the same rule exists in both the validation_custom.ini and the validation.ini, the latter will be ignored. This insures your "CUSTOM" methods will always take precedence over predefined methods.

NOTE: If you are creating new methods or modifying existing methods, you should always select the "CUSTOM" module. Custom methods are exported to a separate ini file (Validation_Custom.ini). This ini file is always read first by the CCS Program when importing validation methods. This allows you to rebuild your validation database in the event of data loss or when you receive a CCS program upgrade that involves changes to the predefined validation methods.

Type:

The Type column determines the type of logic that will be used for the High and Low range comparisons as well as the allowable characters accepted. The type chosen here may or may not be the same type that is defined for any column associated with the Method. For example, a Column specified as a two character (CHAR(2)) column can be associated with a Method designated as an integer (INT) type. This simply states that the column's data and the high and low ranges will be evaluated based on its numerical content and not the alphabetical content. Types are ignored by the Formula fields, with the exception of the "Char No Case" type, which affects both the high and low ranges as well as some string comparison routines when one or more of the formulas involve string handlers.

Help ID:

The Help ID is used to map a particular Method to an HTML page in the CCS Help System. This ID is only utilized when the Control does not contain an internal Help ID. Most Predefined Controls are encoded with a Help ID; however Custom Controls do not contain Help ID's. Therefore, the Help ID allows you to map any custom controls you create to an existing Help Topic. You must edit the HelpMap.dat file (via a text editor), located in the HELP folder (under CCSWin) if you want to define a new Help ID and map it to an existing Help Topic. Presently there is no method to add new Help Topics to the CCS Help System.

Low and High Ranges:

The entered value must fit between the Low and High range to be considered valid. The Comparison logic that is used is determined by the Type Column. If you specify an integer type, the comparison will be done based on the numerical content. If you specify a Date type, the program will attempt to parse the entry as a date and compare the entered date against the value(s) in the range(s). The CCS Program makes no attempt to determine if the Type and Low and High ranges you specify are logically valid, other than the constraints of the Validation Method that is associated with the Validation Forms Columns. (The Validation Forms Columns are validated by Validation Methods just like any other form.)

Mask:

The Mask forces the user's entry to comply with a specific format. Presently the mask is somewhat limited and utilizes only the '#' and '?' symbols. The '#' specifies that only numerical digits between 0 and 9 will be accepted at a specified character position. The '?' specifies that any character will be accepted. All other values force the entry to the specified character.

If, for example, the mask ##/##/#### was encountered, the entry would have to be 2 digits + '/' + 2 digits + '/' + 4 digits. Using ##/##/19## would force a the entry of '19' (12/30/1999 would be allowed but 12/30/2000 would not).

Using a mask of #-###-#### forces a the format of 1-area code-number for telephone numbers.

Note: The mask will be expanded in later versions to provide more capability; however, you can use the string handling functions and the validation formula to precisely control acceptable entry.

Warning Only:

If a column fails validation and the Warning Only is checked, the help message is displayed. However, the entry will be allowed, and the validation logic will continue with the next column.

Beep Also:

If a column fails validation and the Beep Also is checked an audible "Beep" will be sounded as the error message is displayed.

Required:

When a control is associated with a Method that is designated as Required, then the user cannot leave the field empty or the validation will fail. The Required check box overrides that of the Column itself and also determines the error message to be presented to the user.

Note: Which Required check box you check to make a column required determines the error message that is given to the user. Checking the Required check box in the Fields Form will generate the message "COLUMN NAME is a required column", whereas checking the REQUIRED check box in the VALIDATION form will generate the message that is specified in the ERROR MESSAGE column (see below).

Password Level:

When a user logs into a CCS Accounting Program his or her Password is matched against a Password table and given a rating between 0 and 25. This level is then used in various areas of the CCS Accounting series to determine who can access and manipulate data managed by the program.

Note: The trial version implements a very limited version of password protection. The field is mostly ignored with the following exception: In order to change the values of any Validation Method, a user must have a Password Level greater than or equal to the value set in the PASSWORD LEVEL of the Validation Method. As shipped, the PASSWORD LEVEL in each Validation Method is set to either 10 or 25, depending on its role within the program. If you enter the PASSWORD RISKY in the PASSWORD column of the Welcome screen, you will receive a LEVEL of 10. This level will then allow you to edit Validation Methods with levels of 10 or less. Since this initial password is published here and cannot be altered, password protection is essentially non-existent in the trial version. After you purchase a module, it is highly recommended that you change this published password to one of your own choosing.

Default Value (or Formula):

The "Default" expression is evaluated each time a user enters an empty control. The Default column is evaluated as a CCS Script expression. The resulting value is then used as the Default for the column. If the Value does not evaluate as an Expression, then the contents of the Default Column are used as is. In the example pictured above, the default columns text:

@StringDate(@SystemDate() +1);

is evaluated as an expression. In this case, the program gets the system date, adds one (day) to it and then presents it as a string date to the caller (the default Column). The result is that the column always defaults to tomorrow's date. If the column is not empty when it receives the focus, the Default Column will be ignored.

To further exemplify, had the Default Column contained the text "Big Tigers", the column would always default to the value "Big Tigers".

The user is free to change the default it if desired; however, the default entry must pass any specified ranges and the Validation formula or the validation will fail.

The Validation Formula:

Warning:The Validation Formula controls both the validation of controls as well as program flow and behavior of the program itself. A downside to such flexibility is that the Program and all of its data are fully exposed, allowing you to unintentionally cause massive data loss or erratic behavior by the program. CCS recommends that, prior to any changes to this formula you do the following:

1. Back up up your data. (Your ODBC data)

2. Back up your Valid*.ini files.

The Validation Formula is the centerpiece of the Intelligent Fields concept: this concept makes CCS Accounting so uniquely powerful. Used properly by capable personnel, there is virtually no limit to how you can customize a CCS Accounting Program.

The Formula is evaluated each time a control needs to be validated. This occurs any time a control is modified and the form is saved. When the user is Adding records, all columns are considered modified. If a control fails a validation (the expression returns false), the validation logic is halted, the Validation Error Message is displayed, any record updates are suspended, and the offending control receives the focus and awaits correction by the user. If the user makes corrections to the entry, and requests another save (changes records, presses OK, etc.), the validation logic restarts at the first modified column. (Once a column is validated, the modified flag is removed unless it has been changed again). This cycle continues until all controls on the form pass their associated validations or the user cancels the save request. (Note: You can programmatically set the modified flag as well as analyze controls on other forms.)

The Validation formula must be a valid CCS Script Expression, or the Validation Method itself will raise an error, in which case a message indicating the type of error (syntax error for example) will be displayed, and no entry will be accepted for the column.

Note:These methods can also be fired by an event such as when a control receives the focus, or the fielding (reading) of a form. Please ask for a technical reference manual from CCS for details on using event methods.

The Formula can be as simple as the following:

@IsInCombo();

This is a predefined CCS Script Function that checks to see if the user's entry is in the ComboBox's List. If found, the function returns True. If not, it returns False, in which case the validation will fail.

Complex expressions with multiple levels of If statements and sub-routines, including calls to DLL's, natch files etc. can be utilized as well.

The Formula entered here cannot exceed 255 characters: This is by design to insure the validation logic can be quickly loaded and stored into memory, since these formulas are executed repeatedly (the mask is evaluated every keystroke).

However, up to four methods can be incorporated to accommodate larger, more complex formulas:

1. Use the Parent to Child relationship capability, which forces the formula of each parent in the chain to be evaluated successfully prior to evaluating the child's formula.

2. Use the @CallMethod() CCS Script function, which calls other validation Methods (which can call other methods). By calling sub-routines from your main formula, you can pack a lot of code into 255 characters.

3. When you really need some space to work, use the @LoadMethod() routine, which loads an externally edited CCS Script file. This file can be of any length and will be loaded and run as if were defined internally via the validation rule.

4. Create a DLL via another programing language and call it with the CallDll(). This allows you integrate the CCS Script and program with any language you are comfortable with, providing the language is capable of creating a Windows9X/NT DLL. See the CallDll() Function for details.

Note: Formulas are parsed and compiled the first time they are encountered. Therefore changes to external scripts will not affect the validation until the program is restarted. Modifying an internal Method, causes the ALL Formulas to be re-parsed.

See the CCS Script chapter in this help manual for details on the CCS Scripting language.

Error Message:

The Error Message column allows you to specify the text that will be displayed in a message box presented when a Control fails this validation Method. If no message is specified, a default message will be presented to the user.