When to use this endpoint

Find contracts linked to jobs cached by recurring sequences. Use the recurrence ID, not the example job ID, unless a parameter explicitly says otherwise.

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
customerIDFilterInteger-like scalarNoWhen present, select this customer and its immediate non-deleted child customers as type 0, plus directly owned non-deleted assets as type 1. Does not mix same-numbered customer and asset IDs.

Example request

$result = FM_api('JobRecurrence_getAllContracts', ['customerIDFilter'=>'101']);

Example response

[{"name":"Maintenance","id":"52"}]

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":"Unable to read recurrence targets"}Customer/asset expansion query failed.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Collects normalized cached job IDs from matching sequences and returns distinct contract name/ID pairs. Customer expansion is one level and type-aware; it is not recursive.
  • Distinct name/ID pairs preserve separate contracts with identical names.
  • Normalizes positive cached job IDs before SQL. Missing, malformed and duplicate tokens do not become SQL expressions. Only non-deleted jobs and contracts are joined.
  • No recurrence-active restriction, pagination, count envelope or specified ordering. An empty normalized cache yields []; the DB helper may still return false on a failed contract query.

Side effects

  • Read-only; no cache repair, date refresh, history or scheduler changes.

See it in Fieldmotion

CRM1

No direct CRM1 caller found for this variant; its Contracts cell uses JobRecurrence_getContract.

CRM2

Recurring Jobs loads this as contractFilter in moduleRecurring; inspect JobRecurrence_getAllContracts while opening the module.

Related endpoints