Asset maintenance
List legacy asset maintenance rows
/a/AssetMaintenance_getDT
Return CRM1’s paged Asset Maintenance rows with recurrence, owner, and next-job details.
When to use this endpoint
Use AssetMaintenance_getDT for the legacy Assets → Maintenance DataTable. Its positional rows are tailored to that screen rather than a general integration shape.
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 |
|---|---|---|---|
draw | Integer string | No | DataTables request counter, echoed as an integer. Missing becomes 0. |
start | Integer string | No | Zero-based row offset; defaults to 0. |
length | Integer string | No | Page size; defaults to 10. Invalid/negative values are not rejected before SQL. |
daysFrom / daysTo | Integer strings | No | Day offsets from current server datetime; both default to 0. CRM1 defaults to -7 and 7. The predicate selects schedules spanning the lower boundary or created inside the range. |
search[value] | String | No | Substring search across asset name/code, IDs, owner, description, next date, and recurrence dates. DataTables’ regex flag is ignored. |
active | Integer string | No | Exact recurrence active-state filter. Presence with blank value selects inactive rows; omission includes both states. |
order[0][column] / order[0][dir] | DataTables values | No | Columns 0–7 map to maintenance ID, asset ID, owner, description, next date, recurrence creation date, expiry date, and frequency amount. Exact asc ascends; every other direction descends. |
Example request
$table = FM_api('AssetMaintenance_getDT', [
'draw' => '4',
'start' => '0',
'length' => '25',
'daysFrom' => '-7',
'daysTo' => '7',
'active' => '1',
'search' => ['value' => 'filter', 'regex' => 'false'],
'order' => [['column' => '4', 'dir' => 'asc']],
]);
Example response
{
"draw": 4,
"recordsTotal": "12",
"recordsFiltered": "1",
"data": [
[
"61003",
"418",
"Filter service",
["2026-10-15 09:00:00", "2039001", "27"],
"2026-09-24",
["879027", null],
["5", "3"],
["1042", "Acme Services"],
"27",
"1",
"879027"
]
]
}
Rows are positional: maintenance ID, asset ID, description, [nextDate,nextJobID,nextJobUserID], recurrence created date, [recurrenceID,expiryDate], [unit,amount], [ownerID,ownerName], default user ID, active state, and recurrence ID again.
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. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The route and production caller use
AssetMaintenance_getDT, while the PHP function is declaredAssetMaintenance_GetDT. PHP’s case-insensitive function lookup preserves this legacy casing mismatch. recordsTotalcounts every maintenance row, while returned/filtered rows exclude soft-deleted or missing assets and apply date/status/search filters.- The repair runs only for null next dates, uses the recurrence’s unnormalized legacy ID list, and does not repair stale non-null values.
- There is no default ordering when
orderis absent. Equal sort values have no tie-breaker.
Side effects
- Possible repair updates to maintenance linkage fields are written without an activity audit or cache invalidation. Ordinary reads make no changes.
See it in Fieldmotion
CRM1
Open Assets → Maintenance, then filter, search, sort, or page the grid while inspecting AssetMaintenance_getDT.
CRM2
No production CRM2 caller was found. CRM2’s Maintenance page delegates to the generic recurrence module and JobRecurrences_getDataTable.
Related endpoints
AssetMaintenance_exportdownloads the similarly filtered rows.AssetMaintenances_getDescriptionsresolves maintenance labels for recurrence jobs on CRM1’s Jobs list.