---
title: Run a custom validator
summary: Run application-supplied validation logic that participates in the same error pipeline as property-level errors.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Binding.Infragistics111
reference_type: package
operation_id: OP-BIND-007
trigger: "`Validate()` / `RefreshValidation()` reaching a custom validator"
---

# Run a custom validator

Run application-supplied validation logic that participates in the same error pipeline as property-level errors.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-BIND-007 |
| **Trigger** | `Validate()` / `RefreshValidation()` reaching a custom validator |
| **Inputs** | The validation target object, optionally a key property, and a `PropertyValidator` or `CustomValidator` delegate |
| **Outputs** | Messages appended to `ControlErrors`; the binder's error flag |
| **Primary components** | `clsObjectBindManager.AddCustomValidator` (three overloads), `clsCustomValidator.PerformValidation` |
| **Entry point** | `SAIF.Presentation.Web.Binding.Infragistics111/clsCustomValidator.vb` |

## Steps

1. Reset the error flag.
2. Branch on `ValidationType`:
   - `Property` — invoke the `PropertyValidationDelegate` with the bind source, the bind property name, and the `ControlErrors` list so the application appends its own messages ([BR-BIND-051](../business-rules.md#br-bind-051-property-validator-receives-bind-source-and-error-list)).
   - `Method` — invoke the `MethodValidationDelegate` with the validator itself; a `False` return sets the error flag ([BR-BIND-052](../business-rules.md#br-bind-052-method-validator-false-marks-error)).
   - `Object` — when the bind source is a SAIF framework object, resolve and return its `IsValid` property value ([BR-BIND-053](../business-rules.md#br-bind-053-object-validator-returns-isvalid)).

> **Origin**: The `Object` branch delegates to the business object's `IsValid` implementation (`clsBusinessBase`, `SAIF.Framework.Core`); the callee's rule-evaluation steps are not visible from this repository.**

3. A `Nothing` delegate is a silent no-op. ([BR-BIND-054](../business-rules.md#br-bind-054-missing-delegate-is-silent-no-op))

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Validate reaches custom validator]) --> S1[Reset error flag]
	S1 --> D{ValidationType}
	D -->|Property| S2[Invoke PropertyValidator delegate]
	D -->|Method| S3[Invoke MethodValidator delegate]
	D -->|Object| S4[Return bind source IsValid]
	S2 --> End([ControlErrors / error flag updated])
	S3 --> End
	S4 --> End
```

## Failure and edge-case behavior

- In the `Property` branch the delegate populates `ControlErrors` directly but `PerformValidation` never sets `m_Errors = True`, so `ContainsError` stays `False` and the manager does not surface those messages through `Validate()`.*

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified. Statements marked with † were retrieved from dependency library documentation via the Legends CLI RAG service.

## Sources
- SAIF.Presentation.Web.Binding.Infragistics111/clsCustomValidator.vb
