For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
Article

defineValidation

API reference for defineValidation: parameters, properties, and return types.

Use with AI:Rippling AI ChatGPT Claude Cursor

Defines a validation rule for a custom object.

import { defineValidation } from '@rippling/rippling-sdk';

Properties​

PropertyRequiredTypeDescription
apiNameRequired`${string}__c`—
displayNameRequiredstring

Display name of this validation rule shown in the UI.

errorMessageRequiredstring

User-facing error message shown when the validation fires.

Pass an empty string for no message.

levelRequiredValidationLevel

Whether the error is shown at the record level or on a specific field.

One of 'RECORD' | 'FIELD'. When 'FIELD', also set fieldRef.

rqlFormulaRequiredstring

RQL formula that returns true when the record is **invalid**.

Note the violation semantics: a truthy result triggers the error, not a passing check. Example: '(end_time__c <= start_time__c)' fires when end is not after start.

ruleDescriptionRequiredstring

Internal description of this rule (for developer reference only).

Pass an empty string if unused.

stateRequiredValidationState

Whether this rule is active or inactive.

One of 'ACTIVE' | 'INACTIVE'.

fieldRefOptionalNoInfer<DefinitionFieldReference<TObject>>—

Complete options type

Parameters​

ParameterRequiredTypeDescription
objectRequiredTObject—
TypeScript signature
defineValidation<TObject extends ObjectReference>(object: TObject, props: DefineValidationProps<TObject>): Validation;

Returns​

Validation

Availability​

CapabilitySupport
Pull into a projectSupported
Runtime operationsNot available for this helper