Edit

ValidateFieldWithValidationString (windowRef, itemID, validationDefinition)

Definition:  Call this from a ValidateField handler for a code field to validate the field value against an expression or a validation list. This is a programmatic alternative to setting up a custom validation on the field for each user in the UI.

on ValidateField:F_TRANS:E_USER1(w, f, v)
    return ValidateFieldWithValidationString(w, f, "Expr:_value=`abc@`;must start with abc")
end

on ValidateField:F_TRANS:E_USER2(w, f, v)
    return ValidateFieldWithValidationString(w, f, "List:branches")    // validate against the validation list named branches
end

Note that this only validates the field value on exit; it does not offer autocomplete. To also implement autocomplete, use AutoFillField.

Availability:  available within MWScript handlers in v8.1.8 and later.

See Also:

AutoFillAcctDeptField: Apply auto-complete to a departmental account code edit field

AutoFillField: Apply auto-complete to a code edit field

CheckCodeField: Validate a code edit field