Jobs: recurrence settings
Find the earliest incomplete job in an explicit ID list
/a/JobRecurrence_getNextJob
Look up a display date for the earliest incomplete job among cached sequence IDs.
When to use this endpoint
CRM2 uses this as a fallback when a recurring-jobs row has no cached nextDate. It does not automatically discover a recurrence's jobs or require a future meeting.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. The handler explicitly requires a logged-in tenant before parsing or querying IDs. No additional role/department/ownership check is applied.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | Comma-separated positive integer string | Yes for a lookup | Validated CSV, not a JSON/native array. IDs are deduplicated; malformed/nonpositive tokens reject the whole request before SQL. Missing or empty string returns null. |
Example request
$job = FM_api('JobRecurrence_getNextJob', ['ids'=>'1087,1088']);
Example response
{"id":"1088","isComplete":"0","meetingTime":"2026-10-14 10:00:00"}
A valid nonempty list without an active incomplete match returns false. Missing/empty input returns null; '0' is invalid, not an empty lookup.
meetingTime comes from SQL FROM_UNIXTIME(meeting_time_e), not the stored meeting_time string.
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: ids"} | Non-CSV/native array, malformed, overflowing or nonpositive ID. |
false | No active incomplete match, or the database helper reports failure. |
null | Missing/empty-string ids. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Filters nondeleted is_complete=0 jobs and orders by meeting_time_e then id, with LIMIT 1. Overdue/past incomplete jobs remain eligible, consistently with next_date maintenance.
- The list is explicit: no automatic recurrence-membership, assignee or department filtering is added. There is no page size/cursor/offset.
- No writes or next_date repair occur. meetingTime retains database-session FROM_UNIXTIME rendering.
See it in Fieldmotion
CRM1
No direct production CRM1 call was found. Its recurring-jobs table displays sequence next-date data and fetches jobs through separate lookups.
CRM2
Open the recurring-jobs module and inspect a row with no nextDate. The Date Next Job renderer calls JobRecurrence_getNextJob with data.ids and displays returned meetingTime or None.
Related endpoints
JobRecurrence_getreturns the stored child-ID cache.JobRecurrence_checkJobIdscan remove missing/deleted child IDs before a lookup.