Jobs: recurrence workflows and lists
Page recurrences for a customer, its immediate subsidiaries and directly owned assets
/a/JobRecurrence_getByCustomerDT
Page recurrences for a customer, its immediate subsidiaries and directly owned assets.
When to use this endpoint
Page recurrences for a customer, its immediate subsidiaries and directly owned assets.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. All records resolve in the authenticated tenant. This handler has no additional Job edit-bit, department-visibility or owner check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
cid | Integer-like scalar | No | Customer ID, default 0. Missing ID is not rejected. |
start | Integer-like scalar | Yes | Presence required; coerced offset is not checked for negativity. |
length | Integer-like scalar | Operationally yes | Page size read directly without validation/default; supply a positive value. No supported -1 all-rows mode. |
draw | Integer-like scalar | No | Integer echo, default 0. |
order[0][column], order[0][dir] | DataTables order | Operationally yes | Handler reads directly. Column 0=name, 2=expiry, 4=active; all others=name. Exact desc selects descending. |
custasset | String | No | Case-insensitive customer-name or asset-name/code substring lookup, intersected with customer scope. |
search[value] | String | No | Substring match against recurrence name, ID, on_arr or expiry. SQL wildcard characters remain active. |
department_id | Integer-like scalar | No | Nonzero value filters recurrence department. |
Example request
$result = FM_api('JobRecurrence_getByCustomerDT', ['cid'=>'101', 'start'=>'0', 'length'=>'10', 'order'=>[['column'=>'0','dir'=>'asc']]]);
Example response
{"draw":0,"recordsTotal":0,"recordsFiltered":0,"data":[]}
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: start"} | start absent. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Includes the customer itself and immediate child customers (type 0), plus assets owned directly by the requested customer (type 1). Does not recursively include subsidiaries or their assets.
- There is no deleted or active recurrence filter and no extra department permission check. Customer/asset name lookups also have no deleted filter.
- recordsTotal is the entire recurrence-table count, not the customer-scope count; recordsFiltered includes scope and search. Both are converted to integers.
- Each data row is [name, [customer_type, customer_id], notes, user_id, ids, [every,on_arr], files, edate, cdate, active, department_id, id]. Stored JSON/CSV cells remain strings.
- A failed main query is converted to an empty data array; counts may not reliably distinguish failure from no matches. Unsupported page sizes/invalid nested input have no consistent validation response.
- Read-only: missing/deleted cached jobs no longer trigger implicit membership repair. Stored ids and customer identity remain unchanged. Use the checked cache-repair endpoint when repair is intended.
Side effects
- Closes the session write lock; otherwise read-only. No cache, target, edit timestamp, history, next-date or scheduler changes.
See it in Fieldmotion
CRM1
Open a customer → Recurring Jobs. pageCustomerJobsRecurring sends cid, custasset, department and DataTables state. Its rowCallback consumes this exact 12-cell layout.
CRM2
No direct CRM2 call found; moduleRecurring uses the mapped table with customer filters.
Related endpoints
JobRecurrences_listfinds recurrence IDs.