Skills
Update skill mapped fields
/a/Skill_updateData
Update one or more skills through CRM2’s generic field map and record changed mapped fields in history.
When to use this endpoint
Use Skill_updateData for edits made by CRM2’s shared Skills table. The focused CRM1 setters add administrator checks and stricter nonblank handling.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string or native array | Yes | Target ID or already-decoded list of IDs. Scalar mode returns row-specific warnings. Array mode processes sequentially, discards every per-row result, and returns {"ok":1}. JSON array text is not decoded. |
name | String | No | Complete replacement, limited to 100 Unicode characters. Blank and duplicate names are accepted; whitespace is stored without trimming. |
description | String | No | Complete replacement with no endpoint length limit. Blank clears the field. |
cdate | Datetime string | No | Blank becomes SQL null; nonblank text is not date-validated. The actual tenant column is an integer timestamp, so avoid updating this legacy-mapped field. |
lastEdited | Integer string | No | Integer-converted replacement for last_edited. The helper does not automatically advance it because the skill map declares this field as int. |
noRecord | Native array | No | Internal audit control listing mapped keys whose history should be hidden. It does not suppress the database update. |
Example request
$result = FM_api('Skill_updateData', [
'id' => '42',
'name' => 'Electrical testing',
'description' => 'Qualified tester and inspector',
]);
Example response
{
"ok": 1
}
Scalar no-op input returns {"warning":"No Change."}; a missing target returns {"warning":"No data."}; only unknown update keys return {"warning":"no updated fields."}. Supplying only id returns success.
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: id"} | The id key is absent. |
{"error":"name is too long."} | A supplied name exceeds 100 Unicode characters. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Unknown keys are ignored. ID values are integer-converted; scalar zero normally returns
No data.. There is no explicit positive-ID check. - Unlike most mapped objects, a changed skill does not receive current
last_editedautomatically. SupplylastEditedexplicitly if the legacy timestamp must move. - The map calls
cdatedatetime although the schema stores an integer. Nonblank input is passed through to the database without conversion to Unix time.
Side effects
- Changed rows advance the
skillscache marker and receive generic field-level audit entries. - User assignments and stored job/form required-skill IDs are not changed.
See it in Fieldmotion
CRM1
A production-source search found no direct CRM1 caller. CRM1 uses Skill_setName and Skill_setDescription.
CRM2
Open Users → Skills and edit Name or Description. The shared display widget derives Skill_updateData from the API prefix.
Related endpoints
Skill_getRequestedDetailsreads the mapped fields.