[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/admin](../../README) / [index](../README) / replicateAction

# Function: replicateAction()

> **replicateAction**(): [`Action`](../classes/Action)

Defined in: [admin/src/actions/Action.ts:385](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/actions/Action.ts#L385)

Copy a record and open the copy for editing.

The primary key and timestamps are always dropped — a replica is a new row,
not a second claim on the original's identity. Add more with
`.excludeAttributes()`, or adjust the copy with `.beforeReplicaSaved()`:

  replicateAction()
    .excludeAttributes(["slug"])
    .beforeReplicaSaved((data) => ({ ...data, title: `${data.title} (copy)` }))

## Returns

[`Action`](../classes/Action)
