Suppliers
Update one supplier field
/a/Supplier_updateField
Set one mapped field on one or more active supplier rows.
When to use this endpoint
Use Supplier_updateField for a focused mapped-field change when the broader update payload and supplier extension event are not required.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional Suppliers-page, stock, purchasing, role, create, edit, or delete permission check.
All records are selected from the authenticated tenant. CRM1 and CRM2 hide some controls through client-side permissions, but these endpoints do not repeat those UI checks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id or ids | Integer-compatible or native array | Yes | One supplier ID or a native array. id takes precedence when both keys exist. |
field | String | Yes | One exact mapped field name from name, contactName, streetAddress1, streetAddress2, town, county, country, postcode, email, phone, notes, website, taxId, terms, accountNumber, refNumber, isActive, onHold, type, meta, createDate, lastEdited, editedUuid, accountsContact, accountsEmail, additionalEmail, and customValues. |
val | Value compatible with field | Yes | Replacement value. Text limits and email validation follow the map; numeric types are converted. |
Example request
$result = FM_api('Supplier_updateField', [
'id' => 488104,
'field' => 'onHold',
'val' => 1,
]);
Example response
{
"ok": 1,
"oldData": [{"id":"488104","on_hold":"0"}]
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: field"} | The field key is absent. |
{"error":"missing or invalid parameter: val"} | The replacement value key is absent; blank is accepted for text fields. |
{"error":"missing or invalid field"} | The field is not in the supplier map. |
{"error":"missing or invalid parameter: id/ids"} | Neither ID key is present. |
{"ok":"1","warning":"no change required"} | No active selected row needs the replacement value, including when no selected row exists. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Deleted suppliers are excluded from both the comparison and update.
- The
oldDataresponse uses raw database column names and values. - The required
namemap flag is not enforced here, so this route can set a supplier name to blank.
Side effects
- Advances
last_edited, clears the supplier cache, and writes one combined supplier history entry when at least one row changes. - Does not fire
Supplier_editand does not process note mentions.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found.
CRM2
CRM2’s generic inline-update helper can construct <Table>_updateField routes, but no supplier-specific production call was found. Supplier layouts normally save through Layout_setValue.
Related endpoints
Supplier_updateDataupdates several mapped fields and fires supplier events.Supplier_getRequestedDetailsexposes the mapped names accepted here.