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

ParameterTypeRequiredDescription
cidInteger-like scalarNoCustomer ID, default 0. Missing ID is not rejected.
startInteger-like scalarYesPresence required; coerced offset is not checked for negativity.
lengthInteger-like scalarOperationally yesPage size read directly without validation/default; supply a positive value. No supported -1 all-rows mode.
drawInteger-like scalarNoInteger echo, default 0.
order[0][column], order[0][dir]DataTables orderOperationally yesHandler reads directly. Column 0=name, 2=expiry, 4=active; all others=name. Exact desc selects descending.
custassetStringNoCase-insensitive customer-name or asset-name/code substring lookup, intersected with customer scope.
search[value]StringNoSubstring match against recurrence name, ID, on_arr or expiry. SQL wildcard characters remain active.
department_idInteger-like scalarNoNonzero 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

ResponseCondition
{"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