When to use this endpoint

Use AssetMaintenance_updateField only for trusted maintenance repair or generic CRM tooling. Focused workflows should use the recurrence/job operations that keep linked records synchronized.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
fieldStringYesExact map key: id, name, nextDate, history, assetID, cDate, recurrence, meta, recurrenceID, nextAppID, lastDate, or defaultUser.
valMixedYesReplacement value. Integer fields are integer-converted; date/text/datetime fields are quoted. Blank datetime values become SQL null, but nonblank datetime strings are not format-validated.
id / idsInteger string or arrayYesTarget record(s), integer-converted. id takes precedence. Missing IDs are silently omitted; an empty array can produce invalid SQL.

Example request

$result = FM_api('AssetMaintenance_updateField', [
	'ids' => ['61003', '61004'],
	'field' => 'defaultUser',
	'val' => '27',
]);

Example response

{
  "ok": 1,
  "oldData": [
    {"id": "61003", "default_user": "0"},
    {"id": "61004", "default_user": "18"}
  ]
}

When no matched row needs a change, the response is {"ok":"1","warning":"no change required"} and omits oldData.

Errors and unusual responses

ResponseCondition
{"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"}val is absent or null.
{"error":"missing or invalid field"}The exact field key is not in the maintenance map.
{"error":"missing or invalid parameter: id/ids"}Neither target key is supplied.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Only existing IDs are changed. Ordinary fields use one update statement; no active/asset validation is applied.
  • The map has no lastEdited field, so generic updates do not refresh any maintenance edit timestamp.

Side effects

  • Invalidates the maintenance cache and writes one generic activity-log entry for the changed IDs. It does not synchronize linked recurrence/job records.

See it in Fieldmotion

CRM1

No direct production CRM1 caller was found.

CRM2

No direct production CRM2 caller was found; current maintenance editing uses job-recurrence endpoints.

Related endpoints