Jobs: recurrence workflows and lists
Find contracts linked to the cached jobs of one recurring sequence
/a/JobRecurrence_getContract
Find contracts linked to the cached jobs of one recurring sequence.
When to use this endpoint
Find contracts linked to the cached jobs of one recurring sequence. 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Positive recurrence ID; numeric input is coerced with intval unless stated otherwise. |
Example request
$result = FM_api('JobRecurrence_getContract', ['id'=>'1042']);
Example response
[{"name":"Maintenance"}]
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: id"} | ID missing/nonpositive. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Reads the saved job-ID cache and joins those jobs to contracts. An absent recurrence or empty cache returns [].
- Only the name is selected: distinct collapses different contracts with the same name. Use getContractDetails when IDs are needed.
- 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
Jobs → Recurring Jobs, render the Contracts cell; pageJobsRecurring requests this endpoint with the row ID.
CRM2
No direct CRM2 caller found; moduleRecurring uses JobRecurrence_getContractDetails.
Related endpoints
JobRecurrence_getContractDetailsprovides the other contract response shape.