Defines a field on a custom object.
import { defineField } from '@rippling/rippling-sdk';
Properties
| Property | Required | Type | Description |
|---|---|---|---|
apiName | Required | string | CustomObjectStandardFieldIdentifier | — |
description | Required in some variants | string | — |
displayName | Required in some variants | string | — |
section | Required in some variants | null | "general" | ObjectScoped<NoInfer<TObject>, CustomObjectFieldSection> | Extract<keyof NoInfer<TObject>["sections"], string> | SectionReference<NoInfer<TObject>> | — |
standard | Required in some variants | boolean | — |
allowOther | Optional | boolean | — |
currency | Optional | string | — |
databaseModel | Optional | string | — |
dataType | Optional | Data type options | — |
decimalPlaces | Optional | number | — |
derivedAggregatedField | Optional | Derived aggregated field options | — |
derivedFieldFormula | Optional | null | string | — |
detailedOptions | Optional | { [x: string]: JsonValue; }[] | — |
edgeType | Optional | "LOOKUP" | "PARENT_CHILD" | — |
enableParentOwnerInheritance | Optional | boolean | — |
fieldType | Optional | View type | — |
formulaAttrMetas | Optional | null | { [x: string]: unknown; } | — |
indexed | Optional | null | boolean | — |
lookupFilterRqlCondition | Optional | string | — |
lookupFilterRqlMeta | Optional | { [x: string]: JsonValue; } | — |
maxLength | Optional | number | — |
options | Optional | string[] | — |
parentChildType | Optional | "PRIMARY" | "SECONDARY" | — |
referenceStorageType | Optional | string | — |
relatedDataLabel | Optional | string | — |
required | Optional | null | boolean | — |
rqlFormula | Optional | null | string | — |
summary | Optional | Omit<SummarySpec, "filters" | "currencyCode"> & { filters?: NonNullable<FieldProps["summarySpec"]>["filters"]; currencyCode?: string | null; } | — |
summarySpec | Optional | SummarySpec | Internal — set by |
supportedTypes | Optional | string[] | — |
target | Optional | string | AnyCustomObjectDefinition | — |
targetModelRqlName | Optional | string | — |
unique | Optional | null | boolean | — |
Requirements marked “in some variants” depend on the selected union member.
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
object | Required | TObject | — |
TypeScript signature
defineField<TObject extends ObjectReference>(object: TObject, props: DefineFieldProps<TObject>): ObjectScoped<TObject, Field>;
Returns
ObjectScoped<TObject, Field>
Availability
| Capability | Support |
|---|---|
| Pull into a project | Supported |
| Runtime operations | Not available for this helper |