# Validation

> Type reference for Validation in the Rippling SDK, including its public shape and related types.

Defines a validation rule and registers it with the manifest.

A validation rule evaluates an RQL formula on save and blocks the operation when the formula returns `true`. You would normally define validations after the fields they reference.

\*\*Violation semantics:\*\* the formula encodes the \*invalid\* condition, not the valid one. `'(end_time__c <= start_time__c)'` fires when end is before or equal to start — i.e., it is truthy when the record is wrong.

## Type definition

```
export declare class Validation {
    constructor(customObject: ObjectReference, props: ValidationProps & {
        apiName: Config['api_name'];
    });
    getRuleId(): string;
    getCustomObjectApiName(): string;
    getApiName(): Config['api_name'];
    toDict(): Config;
}
```

## Related types

-   [ObjectReference](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/ObjectReference-7acb30a9)
-   [ValidationProps](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/ValidationProps-49e7a151)

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/Validation-23f473fe

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
