record_update()
Update one or more fields on an existing record.
Syntax
record_update(table, id, data, opts?)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
table |
string | yes | Table name or database table id. |
id |
int | yes | The record's primary key. |
data |
array | yes | Field values to change, keyed by field id. Fields you omit are left unchanged. |
opts |
array | no | Options. ["silent" => true] suppresses notifications to the record's followers. |
Returns
true on success. Throws if the record is not found.
Example
record_update("deals", $record["_meta"]["id"], [
"stage" => "won",
"closed_on" => sys_current_date()
]);
Example output
true
Notes
- Only the fields you pass are changed; everything else stays as-is.
- The change is recorded in activity history but does not trigger other automations.
["silent" => true]mutes follower notifications only; newly-assigned users are still notified. See Notifications.
See also: record_create(), record_get()