Forms
Update one mapped form-block field
/a/FormBlock_updateField
Apply one mapped value to one or more form-block rows through the shared generic updater.
When to use this endpoint
Use a dedicated setter for names, code, and images. This lower-level route is useful only for trusted internal mapped-field updates. No production CRM caller was found.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session and is scoped to the authenticated tenant.
The handler performs no record-owner or page-permission check. Definition writes are blocked when the tenant’s features2.disableFormEdits flag is 1, except for the temporary setup user identified by userdata.meta.is_tmp=1.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
field | String | Yes | One mapped name: id, type, name, image, code, parent, cDate, and lastEdited. |
val | Mixed | Yes | Replacement value converted according to the map. |
id / ids | Integer or native array | Yes | One ID or a native array. If both are present, id wins. Values are integer-coerced. |
Example request
$result = FM_api('FormBlock_updateField', [
'id' => '4821',
'field' => 'parent',
'val' => '37',
]);
Example response
{
"ok": 1
}
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"} | Field is absent. |
{"error":"missing or invalid parameter: val"} | Value is absent; blank is still a supplied value. |
{"error":"missing or invalid field"} | Field is outside the map. |
{"error":"missing or invalid parameter: id/ids"} | No target selector is supplied. |
{"error":"form edits are disabled for this account"} | Definition edits are disabled. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Missing IDs and values already equal to the stored value produce
{"ok":"1","warning":"no change required"}. - A changed write also advances
last_editedin Unix seconds, including when another field is targeted. - The update is tenant-scoped and has no block-type filter.
Side effects
- Updates all existing target rows whose selected value differs. Shared change logging may record the mapped change.
See it in Fieldmotion
CRM1
No production CRM1 caller was found.
CRM2
No production CRM2 caller was found.
Related endpoints
FormBlock_setNamepreserves naming rules.FormBlock_setCodepreserves HTML-image storage behavior.