Validate

Use this event to perform project specific validation rules. Use the pValid parameter to return the validation decision. If the parameter remains unchanged or if the event is not implemented, the document state gets valid if all fields are valid.

Syntax

<Fieldn>_Validate (pField as ISCBCdrField, pWorkdoc as ISCBCdrWorkdoc, pValid as Boolean)
Parameter Description
pField Object containing the current field
pWorkdoc Current workdoc object
pValid Parameter containing the current valid state of the field

Sample Code

Private Sub Number_Validate(pField as SCBCdrField, pWorkdoc as SCBCdrWorkdoc, pValid as Boolean)
   'check result of standard validation
   if pValid = FALSE then
      'standard validation returns invalid, stop here
      exit sub
   end if
   'perform additional check for number format
   if IsValidNumber(pField) = FALSE then
      pValid = FALSE
      pField.ErrorDescription = "Field is not a valid number"
   end if
End Sub