Each field of the document is injected in the scripts as a UserField object named UserField_<field name> (or UserField_<alias> when the field has a VBScript alias; spaces and symbols are replaced by underscores). The object gives access to the value and validation of that field in the current document and to its help list.
They exist in document and field events. The batch fields of the job are injected the same way as BatchField_<field name> objects: Value, Validate, ValidateStatus and ValidateMessage work on the value of the batch; the help list methods do not apply to them. The field of another document can be obtained with ChronoDocument.GetField(name).
Properties
Type
Property
Description
string
Value
Value of the field in the current document. Setting it runs the validation and the scripts of the field.
short
ValidateStatus
Validation status of the field in the current document. Set it to 1 (the value is correct) or 0 (the value is incorrect, the document cannot be closed as valid). Script validation overrides the validation rules of the field.
string
ValidateMessage
Message shown to the user when the value of the field is incorrect (ValidateStatus = 0).
Methods
Returns
Method
Description
short
AddListValue
(string value, string description)
Adds a value and its description to the list of a list field. Returns 1 if added.
void
Enable
(short bEnable)
Enables/Disables the field
Parameters
bEnable (short): 1 => Enables, 0 => Disables
void
EnableValidation
(short newVal, short validate = 1)
Enables (1) or disables (0) the validation of the field; validate=1 validates it immediately.
void
ExecuteOnListValueSelect
()
Execute OnListValueSelect script configured for this field
void
ExecuteOnValueChanged
()
Execute OnValueChanged script configured for this field
void
GroupExpand
(short bExpand)
Expand a group field
Parameters:
short, 1 Expand, 0 Contract.
long
HelpList_AddValue
(string value)
Adds values to a help list
Parameters
value (string): Value to add to the list
Returns: Returns the index value
long
HelpList_AddValueDescription
(string value, string description)
Adds values/ descriptions to a help list
Parameters
value (string): Value to add to the list
description (string): Description to show on the help list
Returns: Returns the index value
void
HelpList_Clear
()
Clears the help list of the field (the list of values offered to the user).
string
HelpList_GetValueByDescription
(string description)
Returns the value whose description matches the given text in the help list of the field.
void
HelpList_Populate
()
Shows the help list after filling it with HelpList_AddValue / HelpList_AddValueDescription.
void
Hide
()
Hides the field
void
HideOnGridView
()
Hides the field on grid view
void
Reset
()
Resets the field to its default value and clears its status.
void
SetDefaultValue
(string newvalue)
Sets default value for the field
Parameters
newvalue (string): default value
void
SetFocus
()
Sets focus to the field
void
SetListValue
(string value, string description)
Sets the value of a list field together with its description.
void
SetSel
(short pos, short chars)
Select a range of characters in a field
Parameters
pos (short): start char
chars (short): end char
void
SetValueFast
(string newvalue)
Sets the value of the field without running its scripts or validation (faster than Value for bulk changes).
void
Show
()
Shows the field
void
ShowOnGridView
()
Shows the field on grid view
short
Validate
()
Force the document to "revalidate", for example for calculated fields.