Jobs: recurrence workflows and lists
Page the CRM1 recurring-jobs table with its legacy date and identity filters
POST
/a/JobRecurrences_getDT
Page the CRM1 recurring-jobs table with its legacy date and identity filters.
When to use this endpoint
Page the CRM1 recurring-jobs table with its legacy date and identity filters.
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 |
|---|---|---|---|
start | Integer-like scalar | Yes | Zero-based offset >=0; validated before login. |
length | Integer-like scalar | No | Default 0 means no rows; supply a positive page size. No validation or all-rows -1 contract. |
draw | Integer-like scalar | No | Integer echo, default 0. |
order[0][column], order[0][dir] | DataTables order | No | 0=name, 7=expiry, 9 or 11=active; all others=name. Exact desc selects descending. These indices do not line up with every returned cell. |
showAll | 1 flag | No | Exactly/loosely 1 skips expiry and unknown-target branches only; does not bypass the other supplied filters. |
dateFrom, dateTo, nonExpiring | Date strings / 1 flag | No | When dateFrom is present, filter expiry inclusively through dateTo. nonExpiring=1 also includes NULL, values containing 0000, and 2999-12-31. dateTo should accompany dateFrom. |
unknown | 1 flag | No | When showAll is off, require ID 0 or missing joined customer/asset according to customer_type. Does not independently select all known targets when omitted. |
on_arr | Positive integer-like scalar | No | Modes 3–6 compare interval value; other modes compare CSV element count. Not the same as selected weekday/day value. |
search[value], rec, client | Strings | No | search matches recurrence/customer/asset names, recurrence ID/expiry/selector; rec matches recurrence ID or name; client resolves customer name and asset name/code. Substring wildcards remain active. |
id, department_id, form_id | Integer-like scalars | No | Positive id, nonzero department and nonblank form inputs filter exactly. |
appointmentType | Integer-like scalar | No | Unavoidable legacy wire name for job type. Nonblank and not -1 matches the string-valued stored metadata key appointment_type using JSON_CONTAINS. |
Example request
$result = FM_api('JobRecurrences_getDT', ['start'=>'0', 'length'=>'10', 'showAll'=>'1']);
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"} | Offset absent/negative. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Returns draw/counts/data. Counts are normally strings; recordsTotal counts all tenant recurrence rows, while recordsFiltered applies all filters. Failed row queries become empty data, not a structured database error.
- Every data row has 17 cells: ["", id, name, [customer_type,customer_id], notes, user_id, form_id, ids, [every,on_arr], files, edate, cdate, active, department_id, invoice recurrence ID or "", "", ""]. JSON/CSV cells remain stored strings.
- Date comparisons here use stored date values/server dates, not the checked cleanup’s local cutoff algorithm. No boolean isActive or mapped customerParent filters are supported.
- Customer and asset joins include identity-type guards, preventing a same-numbered unrelated target from matching. No recurrence active/deleted or user visibility restriction is added.
- The table no longer repairs membership or customer identity while reading. Returned CSV and target fields are the stored values; explicit checked mutation endpoints handle repairs.
Side effects
- Read-only: no cached-membership or customer-identity mutation, edit marker, history, scheduler/reminder or next-date reconciliation.
See it in Fieldmotion
CRM1
Jobs → Recurring Jobs: pageJobsRecurring sends DataTables state plus screen filters and consumes the 17-cell row layout. Filter Network for JobRecurrences_getDT.
CRM2
No direct CRM2 call found; Recurring Jobs uses the mapped table path.
Related endpoints
JobRecurrences_getDataTableis the distinct CRM2 mapped table contract.