# defineField

> API reference for defineField: parameters, properties, and return types.

Defines a field on a custom object.

```ts
import { defineField } from '@rippling/rippling-sdk';
```

## Properties

| Property | Required | Type | Description |
| --- | --- | --- | --- |
| `apiName` | Required | `string \| [CustomObjectStandardFieldIdentifier](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/CustomObjectStandardFieldIdentifier-cfaf13ad)` | — |
| `description` | Required in some variants | `string` | — |
| `displayName` | Required in some variants | `string` | — |
| `section` | Required in some variants | `null \| "general" \| [ObjectScoped](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/ObjectScoped-8d774b33)<NoInfer<TObject>, [CustomObjectFieldSection](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/FieldSectionReference-f076b56f)> \| Extract<keyof NoInfer<TObject>["sections"], string> \| [SectionReference](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/SectionReference-a1fcbf01)<NoInfer<TObject>>` | — |
| `standard` | Required in some variants | `boolean` | — |
| `allowOther` | Optional | `boolean` | — |
| `currency` | Optional | `string` | — |
| `databaseModel` | Optional | `string` | — |
| `dataType` | Optional | `[Data type options](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/defineField-dataType-84c32228)` | — |
| `decimalPlaces` | Optional | `number` | — |
| `derivedAggregatedField` | Optional | `[Derived aggregated field options](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/defineField-derivedAggregatedField-71b38a3c)` | — |
| `derivedFieldFormula` | Optional | `null \| string` | — |
| `detailedOptions` | Optional | `{ [x: string]: JsonValue; }[]` | — |
| `edgeType` | Optional | `"LOOKUP" \| "PARENT_CHILD"` | — |
| `enableParentOwnerInheritance` | Optional | `boolean` | — |
| `fieldType` | Optional | `[View type](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/defineField-fieldType-d8b2dc31)` | — |
| `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](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/SummarySpec-831699e9), "filters" \| "currencyCode"> & { filters?: NonNullable<[FieldProps](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/FieldProps-d32a6388)["summarySpec"]>["filters"]; currencyCode?: string \| null; }` | — |
| `summarySpec` | Optional | `[SummarySpec](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/SummarySpec-831699e9)` | Internal — set by `SummaryField`; drives the `derived_aggregated_field` wire field. |
| `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.

[Complete options type](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefineFieldProps-b635176b)

## Parameters

| Parameter | Required | Type | Description |
| --- | --- | --- | --- |
| `object` | Required | `TObject` | — |

TypeScript signature

```ts
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 |

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/defineField

> 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.
