Scheduler saving and live sync

Available in **12.5.0 **.

Scheduler saving and live sync

The Scheduler saves every calendar change (drag and drop, copy and paste, cut and paste, delete, cancel, templates, auto match) in the background while the user keeps working. This article explains what the user sees, what the save engine guarantees, how changes made by other users appear on the calendar, the keyboard shortcuts, and the settings that tune all of it.

It is written for implementation consultants, system admins and support engineers. For the rest of the Scheduler configuration see Scheduler app.

What users see

Moment What the user sees
A change is waiting or being saved The tile shows its saving state. The header shows Saving….
Everything is saved The header shows All changes saved for three seconds, then clears. After a change that could not be saved the header clears without that message.
A save fails The tiles snap back to their last saved state and one toast explains what happened, for example Not saved (3), changes reverted: Shift end must be after start.
Part of a large change fails One toast, for example 180 saved, 20 not saved (reverted): ... (see Large changes).
An action skips some items One toast lists the count and the reasons, for example 3 pasted, 2 skipped: cannot be moved right now.
The user closes or reloads the tab with unsaved work The browser asks for confirmation before leaving.

The header Saving… indicator also covers the compliance check that runs after a save, so it clears once the affected workers have been re-checked. The leave page prompt follows the same rule.

What a save guarantees

Transaction boundaries

Changes waiting in the save queue are sent together and saved in a single transaction, up to the configured batch size. Either every record in it is saved, or none is. Inserts and updates run first, then deletes, with child shifts deleted before their parent demand.

This applies to every queued action: moving one shift or fifty, pasting a selection, deleting a selection, cancelling, creating shifts from a template, and auto match assignments.

A drag waits 300 milliseconds before it saves, so a quick burst of drops is saved together.

Changing the date, the view or the group first sends any waiting change immediately and waits until saving has finished, because the calendar reloads its shifts on navigation. The header shows Saving… meanwhile.

Only the changed fields are written

The Scheduler keeps a copy of each record as it was last read from the server. When a shift is updated, only the fields that differ from that copy are sent. A field the user did not touch is never written, so a change another user made to a different field of the same shift is not overwritten.

New records send all of their fields. Fields that are not updateable for the user, relationship fields and display only fields (additionalFields entries with readOnly: true) are never sent.

If the user drags a shift away and back before the save starts, nothing is sent for it.

One save per record at a time

A shift has at most one save in flight. If the user changes it again while it is saving (for example a second drag), the second change waits and is sent as soon as the first one has finished. The server reply for the first save never overwrites the newer position on screen.

When a save fails

A failed save never leaves a tile in a half saved state:

Change After a failure
Update (move, reassign, cancel, quick action) The tile returns to its last saved values.
New shift (paste, template, demand assignment) The tile is removed.
Delete The tile is restored.
Cut and paste The copy is removed and the original stays where it was.

Any later queued change the user made to the same shift while the failed save was in flight is dropped too, because it was made on top of a state that was never saved. If that later change was part of a group that saves together (a demand with its child shifts, or a cut and paste), the rest of the group is dropped and snapped back as well, so related pending changes are reverted together.

Because the transaction is all or nothing, the rows that were fine are reported with Not saved: another change in the same request failed. The toast shows the real reason from the failing row.

After a successful save

  1. The saved records are re-read from the server, so formula fields, roll ups and values set by triggers or Flows show at once. Set disableEventSaveRefresh: true to skip this re-read (see Settings).
  2. A parent demand whose child shift changed is refreshed, so its fill count is correct.
  3. Compliance runs for every worker whose shift changed. When a shift is reassigned or unassigned, the worker it was taken from is re-checked as well, because their other shifts may no longer conflict.

New records get their Id from the save result straight away, so a shift can be dragged again immediately after it is pasted.

Large changes

The maximum number of records per transaction is the Upsert Batch Size field on the WFM custom setting (b3s__Scheduler__c.b3s__Upsert_Batch_Size__c, default 200). The same setting is used by the bulk forms described below.

When a single action touches more records than that, the Scheduler saves it in consecutive transactions:

A single demand with more child shifts than the batch size is still split across transactions. Raise the batch size if your demands are that large, keeping in mind that a very large batch can reach Salesforce governor limits (triggers, Flows and validation rules all run in the same transaction).

Deleting a demand

Deleting a demand also deletes the child shifts of that demand that are loaded on the calendar, in the same transaction, children first. A child that cannot be deleted right now (locked, saving, or restricted) is left out and the demand is still deleted. Child shifts that are not loaded are not deleted by the Scheduler; what happens to them depends on the demand lookup and any automation in your org.

Copy, cut and paste

Copy, cut, paste and delete are refused with Data is still loading. Please try again in a moment. while the calendar is loading its events or a loader is loading. A background refresh of the matching and compliance loaders does not block them.

Moving shifts

Forms that save several records

The shared record form saves several records in one request, all or nothing, with the results returned in the order of the records. This covers:

If any record fails, no record is saved and the form shows each distinct error once. Up to the Upsert Batch Size (default 200) the set is one transaction. A larger set is sent in chunks of that size, and each chunk is all or nothing on its own.

Live sync of other users' changes

Every syncTimeout seconds (default 15) the Scheduler asks the server what changed since its last check, for shifts and for requests, and merges the answer into the calendar without reloading it.

Change made elsewhere What the calendar does
A loaded shift was edited The tile updates in place.
A new shift in the visible period The tile appears.
A shift was deleted The tile disappears.
A shift was edited so that it left the visible period or the view's selection The tile disappears.
A record for a row that is not loaded (for example a worker not in the resource list) The calendar refreshes in full.
More than 2,000 changes or deletions since the last check The calendar refreshes in full.

What the sync never does:

Changes are detected on the record's SystemModstamp, which also moves when a roll up summary on the record is recalculated (for example the blocking alert count after another user's compliance check). Each check looks back 30 seconds past the previous one, so a change committed by a long running transaction is not missed. Seeing the same change twice is harmless. A change already on the calendar is skipped when SystemModstamp is among the fields the shift or request definition loads; otherwise it is simply applied again.

The first check after the page opens only reads the server clock. Changes start to appear from the second check onwards.

Who sees what

The sync runs as the signed in user with object, field and sharing access enforced. A user only learns about records they are allowed to see. Deletions are read from the Recycle Bin, so a deletion made by another user appears only if the signed in user can still see that deleted record.

Keyboard shortcuts

Shortcuts are ignored while the user is typing in a field, while a record form is open, and when Alt (or Ctrl/Cmd with Shift) is held, so browser shortcuts keep working. A shortcut with nothing to act on is left to the browser.

Shortcut Action
Ctrl/Cmd + A Select every tile shown (tiles hidden by a filter are not selected).
Ctrl/Cmd + C Copy the selection. Does nothing when nothing is selected.
Ctrl/Cmd + X Cut the selection.
Ctrl/Cmd + V Paste at the calendar cell under the pointer. In a resource view the pointer must be over a row cell, otherwise the user sees Move the pointer over a calendar cell to paste.
Delete Delete the selection. It always asks for confirmation first, also for one item. Backspace does nothing. Items that cannot be deleted are skipped and counted.
Escape Clear the clipboard (and the cut or copied look of the tiles) and the selection.

Mouse selection:

Action Result
Click Select one tile.
Ctrl/Cmd + click Add or remove a tile from the selection.
Shift + click Add every tile in the same row between the last clicked tile and this one. Across different rows, and in views without resource rows (month, list), only the clicked tile is added.
Double click Open the editor. Both clicks must be on the same tile.

Compliance during saving

Auto match

Settings

Setting Where Default Effect
Upsert Batch Size WFM custom setting, b3s__Scheduler__c.b3s__Upsert_Batch_Size__c 200 Maximum records per save transaction, for the calendar and for multi record forms.
syncTimeout Scheduling Context Provider JSON, root 15 Seconds between live sync checks.
disablePooling Scheduling Context Provider JSON, root false true turns live sync off. Other users' changes then appear only after navigation or a reload.
disableEventSaveRefresh Scheduling Context Provider JSON, root false true skips re-reading saved records. The tile keeps the values that were sent, and formula fields, roll ups and trigger or Flow stamps show after the next sync or refresh. Use it only on very large boards.
{
    "syncTimeout": 15,
    "disablePooling": false,
    "disableEventSaveRefresh": false
}

No extra permission is needed for the sync or the save engine: the user's normal object, field and sharing access applies.

Known limits

For integrators: rollback reporting

The upsertRecords, deleteRecords and commitBatch services on b3s.RemoteRecordsManager roll the whole request back when one row fails. After a rollback every row is returned with isSuccess: false and no recordId. Rows that would have passed carry the message Not saved: another change in the same request failed. (custom label Records_RolledBack).

If you call these services from your own code with the default atomic behavior, treat any failed row as a failure of the whole request. From 12.8.0, the Shift Importer opts into partial upserts so valid rows can save independently. Scheduler saves retain the atomic behavior described here. Request and response examples: Apex and automation API reference.

Troubleshooting

Symptom Cause / fix
A move snapped back with a toast The save failed (validation rule, trigger, permission, record lock). The toast shows the server's message. Fix the cause and repeat the move.
Many tiles snapped back although only one was wrong Expected: every record in the failed transaction is rolled back. The toast names the failing row's error.
A cut and paste did nothing for some tiles Their originals could not be deleted (locked by compliance, saving, a delete restriction or no delete access). The toast lists them as cannot be moved right now.
Another user's change takes a while to appear It appears on the next sync check (syncTimeout). It waits longer while you have saves or compliance checks running, or a form open.
Another user's deletion never appears The user cannot see the deleted record in the Recycle Bin, or it was hard deleted. Reload the page.
The calendar sometimes refreshes completely More than 2,000 changes arrived at once, or a change belongs to a row that is not loaded. This is the safe fallback.
Formula or roll up values on a tile are stale after a save disableEventSaveRefresh is true. They update on the next sync or refresh.
An import reports every row of a batch as failed One row of that batch failed and the batch was rolled back. Fix the row with the real error and import again.