Write data
write_dataCreate or update a record. When updating a non-existent record (id > 0), the record is automatically created. Returns the record id. User groups (susergroups) and rights groups (srightsgroups) can be written as well; the susers table (users) cannot. The system column, which protects built-in records against deletion, cannot be written. Membership of users in user groups and of user groups in rights groups is stored in link tables that are not available through this server. File and Image columns store an attachment id — create the attachment first with create_attachment and write the returned id. Text columns that a new record does not receive are stored as an empty string, as the edit form does; default values of controls are not applied. Set history to true to record the change the same way the user interface does; see the history parameter.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "<table>",
"values": "<values>"
},
"name": "write_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Record id: 0 = new record (auto-generated id), >0 = update or create if not exists. | |
| table | Yes | Table name, e.g. ng_invoice. | |
| values | Yes | Column names with values to write (ng_amount, ng_status, etc.). Can be provided as separate 'id' parameter or within 'values' object. | |
| history | No | Record the change in the change history and let it take part in synchronization, exactly as a change made in the user interface does. Default false — the record is written without any trace in the history. Use true for changes that have to stay auditable or that some part of the platform reacts to, and false for bulk writes such as demo data, where the history would only grow without telling anyone anything. |