Assets
Set an asset value
/a/Asset_setValue
Replace the decimal value stored on one asset after permissive numeric conversion.
When to use this endpoint
Use Asset_setValue for the focused asset-value field in CRM1.
Normalize and range-check monetary input before calling; this handler is more permissive than asset creation.
Authentication and permissions
The handler requires an authenticated tenant context, established by signed API-key fields or a CRM session. It checks the tenant table prefix but does not separately require a logged-in user ID.
No page, role, or asset permission is checked.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Server-side asset ID after integer conversion. The existence check includes soft-deleted assets. |
val | Numeric string | Yes | Converted with floatval and interpolated as a number. Nonnumeric text and blank become 0. Unlike Asset_new, this setter has no explicit maximum check. |
Example request
$result = FM_api('Asset_setValue', [
'id' => '4821',
'val' => '1250.00',
]);
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":"no ID provided"} | id is omitted. |
{"error":"no val provided"} | val is omitted. |
{"error":"asset does not exist"} | No asset row has the converted ID. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- There is no no-change shortcut and negative values are not explicitly rejected.
- The endpoint can update archived or soft-deleted assets.
- This is a single-record mutation; it provides no list filtering or pagination.
Side effects
- Attempts to update
valueandlast_edited, setsedited_uuidtoAsset_setValue, invalidates the asset cache, and writes an asset audit entry.
See it in Fieldmotion
CRM1
Edit Value on an asset edit page or customer Assets tab and filter Network requests for Asset_setValue. The customer Assets table coerces its input to a JavaScript number before sending it.
CRM2
No direct production CRM2 call to Asset_setValue was found; CRM2 uses its broader update contract.