AddValidator Method

The AddValidator method validates an event. It allows you to write a custom validation for any event. It returns one of the following values:

  • true. Validated the event successfully.

  • false. Did not validate the event successfully.

It uses the following syntax:

Addvalidator(siebConsts.get("event_name"), function(){custom validation}

where:

  • event_name identifies the name of the event that AddValidator validates.

For example, the following code validates the control focus event:

this.AddValidator(siebConsts.get("PHYEVENT_COLUMN_FOCUS"), function(row, ctrl, 
val){
if(ctrl.GetDisplayName() === "Account" && val === "Hibbing Mfg"){
return true;
});

You can configure Siebel Open UI to use the value that AddValidator returns to determine whether or not to stop running handlers for an event. For more information, see AttachEventHandler Method.

For more information about events, see Siebel CRM Events That You Can Use to Customize Siebel Open UI.