# defineAction

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

Defines an action on a custom object.

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

## Properties

| Property | Required | Type | Description |
| --- | --- | --- | --- |
| `apiName` | Required | `` `${string}__c` `` | — |
| `function` | Required | `[FunctionReference](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/FunctionReference-77f9d9d2)` | Function invoked by the action. |
| `name` | Required | `string` | Display name shown in the list or detail view. |
| `visibilityPreferences` | Required | `[CustomObjectActionVisibilityPreference](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/CustomObjectActionVisibilityPreference-542a2b7c)[]` | Views where the action is shown. |

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

## Parameters

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

TypeScript signature

```ts
defineAction(object: ObjectReference, props: DefineActionProps): CustomObjectAction;
```

## Returns

```
CustomObjectAction
```

## 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/defineAction

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