Generic action for updating existing entity records in the database. This action provides a flexible way to update records for any entity type by accepting the entity name, primary key, and field values as parameters.

Example

// Update a customer record
await runAction({
ActionName: 'Update Record',
Params: [
{
Name: 'EntityName',
Value: 'Customers'
},
{
Name: 'PrimaryKey',
Value: { ID: '123e4567-e89b-12d3-a456-426614174000' }
},
{
Name: 'Fields',
Value: {
Email: 'newemail@example.com',
Status: 'Inactive',
UpdatedAt: new Date()
}
}
]
});

Hierarchy

  • BaseRecordMutationAction
    • UpdateRecordAction

Constructors

Methods

  • Updates an existing record for the specified entity type.

    Parameters

    • params: RunActionParams<any>

      The action parameters containing:

      • EntityName (required): The name of the entity to update
      • PrimaryKey (required): Object containing primary key field(s) and value(s)
      • Fields (required): Object containing field names and values to update

    Returns Promise<ActionResultSimple>

    ActionResultSimple with:

    • Success: true if record was updated successfully
    • ResultCode: SUCCESS, FAILED, ENTITY_NOT_FOUND, RECORD_NOT_FOUND, VALIDATION_ERROR, PERMISSION_DENIED, NO_CHANGES, CONCURRENT_UPDATE
    • Message: Details about the operation
    • Params: Output parameter 'UpdatedFields' contains the fields that were actually changed
  • Executes the action with the provided parameters.

    Parameters

    • params: RunActionParams<any>

      The action execution parameters including context

    Returns Promise<ActionResultSimple>

    Promise resolving to the action result