Jobs: recurrence settings
Replace the shared recurrence notes
/a/JobRecurrence_setNotes
Save notes shared by a recurring-job sequence rather than the individual job's notes.
When to use this endpoint
Use after getNotes to save the entire shared notes value, not to append a note to an individual job.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Tenant context is required. The Job edit-restriction bit 128 applies, with the existing client-administrator exception.
IDs resolve inside the authenticated tenant. There is no additional department-visibility or recurrence-ownership filter.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Positive recurrence ID in canonical integer form; not a job ID. The record must exist. |
val | String | No | JSON note array/object as text, or legacy plain text. Omitted/blank clears to []. Native request arrays are rejected. |
Example request
$result = FM_api('JobRecurrence_setNotes', ['id'=>'1042', 'val'=>json_encode([['content'=>'Inspect access equipment.']])]);
Example response
{"ok":1}
A post-save follow-up failure adds saved=1 and warning/warnings without undoing the settings. Read the warning and reload affected objects rather than blindly replaying the operation.
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, invalid or not positive. |
{"error":"job recurrence 1042 does not exist"} | No matching recurrence; numeric ID varies. |
{"error":"No permission to edit"} | The Job edit restriction applies and the caller is not a client administrator. |
{"error":"Unable to save job delivery changes"} | The checked local transaction failed; settings/history are rolled back. |
{"error":"Invalid saved recurrence metadata"} | The saved metadata cannot be decoded as an array/object; it is not silently erased. |
{"error":"missing or invalid parameter: val"} | The value is missing when required, has an unsupported type, or fails the operation-specific range/shape/date rules. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Replaces the whole shared notes document. A decoded array/object is retained; other truthy text becomes one content entry. The string '0' clears to [].
- The handler does not invent note authors/timestamps or send a mention/email notification. Mobile sync downloads these shared notes through its intermediary.
- Does not independently regenerate jobs. A notes-only Job_save recurrence edit also leaves generated children intact.
- The surrounding Job_save recurrence editor invokes this setter internally. Its wider generation-setting save separately requests reset-from-now and now propagates failures/saved warnings. Direct endpoint effects above do not describe the whole editor save.
Side effects
- The existing recurrence is locked and changed settings, edit timestamp/operation marker and history are committed together in a checked local transaction. Failed local persistence rolls back; an unchanged value normally returns ok without a new local write.
- Cleanup, child-target changes and global scheduler/reminder reconciliation run after the local save. A failed follow-up preserves committed settings and returns ok=1, saved=1, warning/warnings. Inspect current state and any partial progress before retrying; tenant and global effects are not distributed-atomic.
See it in Fieldmotion
CRM1
Open a job's recurrence notes or the Notes cell in Jobs → Recurring Jobs. Saving the note editor calls JobRecurrence_setNotes with JSON text. Customer recurring-job notes use it too.
CRM2
No direct production CRM2 caller to this focused endpoint was found. The job recurrence editor carries configuration through Job_save; the recurring-jobs module also uses JobRecurrence_set and mapped updates. The shared job recurrence editor also reaches this setter indirectly through Job_save; observe Job_save in the Network panel rather than expecting a separate request to this focused route.
Related endpoints
JobRecurrence_getNotesretrieves the stored JSON text before editing.JobRecurrence_getreads the complete recurrence.