Scheduler app

The Scheduler is the internal shift scheduling UI. Scheduling staff use it to manage shifts, fill open demands, check compliance, match candidates to shifts, and send bulk notifications, all on a resource timeline calendar. It solves the day to day rostering problem: who is working, where, when, whether they are qualified and compliant, and which open requirements still need filling. It is the only WFM app that is not portable, and it always runs as an authenticated internal or community user.

What it is and who uses it

The audience is your scheduling and operations team, not candidates or clients. Where the candidate companion app and the sub vendor portal are guest facing and portable, the Scheduler is a back office tool that assumes an authenticated Salesforce user with real object access. Typical tasks:

Where it runs

How it is configured, context providers

The scheduler's entire app definition is a single JSON blob on a b3s__Scheduling_Context_Provider__mdt record. Two fields matter:

Field Purpose
b3s__Object_Name__c Leave blank for a global default. Set it to an object's API name (for example Account, Contact, b3s__Job__c) to load this definition when scheduling in the context of that object. Set it to the Name of a Group to drive scheduling within a sharing group.
b3s__JSON__c The entire app config as one JSON blob (top level keys, views and schedulables).

The package ships sample providers named Account, Contact, Job and Group as Custom Metadata records included as sample configuration with the package. They are starting points, meant to be copied and adapted to your object model.

How a definition is resolved

At boot the server derives the context object from the record the scheduler was opened on: an Account Id resolves to Account, a Job Id to b3s__Job__c, and so on. It then loads the provider whose b3s__Object_Name__c matches that object exactly. The resolution order is:

  1. By context object if the scheduler was opened on a record.
  2. Else by the caller's resolved sharing group (see below).
  3. Else by the user's default group assignment name.

The same key selects the provider whose b3s__Loaders__c field holds its loaders, so a provider and its loaders are always scoped to the same context object or group. The client remembers the key the definition was resolved by, so later data calls re-resolve the same definition server side.

Sharing groups

Sharing groups let you schedule across a portfolio of accounts or workers that is not tied to a single record.

At boot the server reads the running user's group assignments, resolves the default group (the assignment flagged default, else the first), and returns the group list so the UI can offer a group switcher. The resolved group name is what matches a Group context provider.

Because a group is a collection rather than a single record, a group flavoured schedulable usually cannot express its data scope as a simple bound clause. Instead of a selectionClause, the shipped Group provider points at an Apex filter, for example "apexFilter": "GroupShiftLoader", which returns the Ids to constrain the query. See Apex filters.

App definition options

Top level keys in the provider JSON:

Key Controls
timezonePreference user to render in each user's timezone, or a site/client preference to render in the shift location's timezone.
firstDay First day of the week for the grid (1 is Monday).
nextDayThreshold HH:mm:ss, default 09:00:00. An overnight shift that ends before this time shows only in the day cell it starts in, in month and day-slot views. Set 00:00:00 to make it cover the next day's cell as well.
is24Hour 24 hour versus 12 hour time display.
syncTimeout Seconds between live sync checks for other users' changes. Default 15.
disablePooling Turns off live sync when true.
disableEventSaveRefresh Skips re-reading saved records when true. Formula, roll-up and automation values then appear on the next sync or refresh.
slotMinWidth Minimum width, in pixels, of a resource column on the timeline.
notifications Boolean, or { enabled, defaultChannels }. The root gate for the bulk notification engine. See Scheduling notifications.
views Array of calendar view definitions. See Views below.
schedulables Object keyed by schedulable type (shift, placement, request, invitation, break, task). Each maps one Salesforce object onto a calendar event source.

A handful of presentation keys also sit at the root of the definition: resourceAreaWidth (width of the left resource column), slotLabelFormat and listDaySideFormat (date/time header formatting), timeZone, height and dayMaxEventRows.

{
    "notifications": true,
    "timezonePreference": "user",
    "firstDay": 1,
    "is24Hour": true,
    "disablePooling": false,
    "disableEventSaveRefresh": false,
    "slotMinWidth": 200,
    "schedulables": { "shift": { }, "placement": { }, "request": { }, "invitation": { } },
    "views": [ ],
    "resourceAreaWidth": "20%",
    "timeZone": "local",
    "height": "100vh",
    "dayMaxEventRows": 4
}

For the shared JSON grammar (conditions, selectors, formatters, merge placeholders) see App definition JSON reference.

Views

views is an array. Each entry is one selectable view in the toolbar, backed by a resource timeline calendar. Common keys:

Key Controls
name View id (byWorker, byJob, bySite, byMonth, byList in the shipped config).
type / label Toolbar label.
icon Inline SVG for the toolbar button.
active true marks the default view on load.
config Calendar config for this view: grid type (for example a two week resource timeline, a month grid, or a day list), slot duration and stacking.
increment How the next/previous buttons page (for example { next: { days: 14 }, prev: { days: -14 } }).
shiftTitle, requestTitle, placementTitle Per schedulable, the ordered fields shown on an event in that view.
resources For resource timeline views, the left hand rows. static rows (for example an "Unassigned" lane keyed by a lookup) plus dynamic rows pulled from a loader (workers, jobs or sites), each with resourceId, title, sort and additionalFields.

The shipped Account provider offers five views: by worker, by job, by site (each a two week resource timeline), by month (a month grid) and a day list.

Schedulables

Each schedulables.<key> entry maps one Salesforce object onto the calendar. Beyond shift, the shipped config includes:

The most important schedulable is shift.

The shift schedulable in depth

"shift": {
    "objectType": "b3s__Shift__c",
    "startFieldPath": "b3s__Scheduled_Start_Time__c",
    "endFieldPath": "b3s__Scheduled_End_Time__c",
    "actualStartFieldPath": "b3s__Actual_Start_Time__c",
    "actualEndFieldPath": "b3s__Actual_End_Time__c",
    "absoluteStartFieldPath": "b3s__Absolute_Start_Time__c",
    "absoluteEndFieldPath": "b3s__Absolute_End_Time__c",
    "siteTimezoneFieldPath": "b3s__Work_Site__r.b3s__Timezone__c",
    "demandParentFieldPath": "b3s__Shift_Demand__c",
    "demandRequiredStaffFieldPath": "b3s__Required_Staff__c",
    "demandAssignedCountFieldPath": "b3s__Assigned_Shift_Count__c",
    "preventOverFillDemands": true,
    "contactFieldPath": "b3s__Contact__c",
    "contactsLoader": "contacts",
    "selectionClause": [
        "b3s__Work_Job__r.b3s__Account__c =:contextId OR b3s__Work_Site__r.b3s__Account__c =:contextId"
    ],
    "matchingLoaders": ["contacts", "certificates", "certRequirements", "suitability", "sites", "workerContracts"]
}

Field paths

The shift schedulable is driven entirely by field paths, so it adapts to your object model without code changes.

Key Meaning
objectType The shift object (b3s__Shift__c).
startFieldPath / endFieldPath Scheduled start/end that position the event on the grid.
actualStartFieldPath / actualEndFieldPath Clocked actual times, surfaced as "shift started / ended" decorations.
absoluteStartFieldPath / absoluteEndFieldPath Timezone absolute mirrors used for sorting and cross timezone display.
siteTimezoneFieldPath Path to the shift location's timezone, used when the app renders in client/site time.
contactFieldPath The assigned worker lookup (empty on a demand or an open shift).
contactsLoader The loader that supplies assignable workers.
shiftInvitesCountFieldPath Rollup of outstanding invitations, shown on the event.
lookBackExtendDays / lookForwardExtendDays Widen the fetched window a little past the visible range so overlapping shifts render fully.

Demands, demandParentFieldPath and demandRequiredStaffFieldPath

See Shifts versus demands below.

selectionClause

An array of SOQL fragments OR'd together to scope which shifts load. Fragments support merge placeholders such as :contextId, and the whole query is built and run server side, never on the client. Group providers replace this with apexFilter (or matchApexFilter for the matching query). See Data loaders and Apex filters.

matchingLoaders

A list of loader names the matching engine refreshes and cross references when suggesting or validating candidates (contacts, certificates, certificate requirements, suitability, sites, worker contracts). See Shift matching below.

quickActions

Toolbar buttons on a selected event that stamp field values without opening the drawer. Each has a label, inline icon, success/error/confirmation messages, a visibleIf condition, and an updateFields array. The shipped shift offers Confirm, Cancel and Request shift swap, each flipping b3s__Status__c.

{
    "label": "Confirm",
    "successMessage": "Shift confirmed",
    "visibleIf": { "condition": { "allOrSome": "all", "selectors": [
        { "field": "b3s__Status__c", "operator": "notequals", "value": "Confirmed" }
    ] } },
    "updateFields": [ { "field": "b3s__Status__c", "value": "Confirmed" } ]
}

contextMenu

The right click menu. recordNavigate entries open a related record (working pattern, the shift itself). The canCut, canCopy, canEdit, canClone, canDelete and canMatch conditions gate the cut/copy/paste, edit, clone, delete and match actions per event (for example, disabled once a shift is cancelled). A null value leaves an action always enabled.

recordFormFields with per field views, showIf and disabled

recordFormFields defines the shift edit drawer. Each entry is a field, a separator or a related list. Three controls make one form serve several modes:

Related list field types (type: "task", type: "break", type: "record-files-manager") embed child record management inline, each with its own title, recordFormFields, and canCreate / canEdit / canDelete gates. Field level details (types, props, enableRepeatPattern, loaders, createAction) are documented in the Record form field reference.

{
    "field": "b3s__Cancellation_Reason__c",
    "type": "field-select",
    "views": { "shiftView": true, "bulkEditView": true, "blukCreateView": true },
    "required": true,
    "showIf": { "condition": { "allOrSome": "some", "selectors": [
        { "field": "b3s__Status__c", "operator": "equals", "value": "Cancelled" }
    ] } }
}

A separate cancelFormFields array defines the smaller form shown by the cancel flow.

decorations, topBorder and background

Visual state overlays, all condition driven:

The Account, Contact, Job and Group sample providers include a VMS badge on every shift whose b3s__Is_VMS__c is true. It appears alongside the status icons in every calendar view, including on demand and assigned child shifts when their own VMS flag is true. False or missing values do not show a badge. Hovering the badge shows VMS shift.

For an existing or custom provider, add this entry to schedulables.shift.decorations in its b3s__JSON__c field. Preserve the other decorations; add it only once per provider. The condition automatically includes b3s__Is_VMS__c in shift loading, so no extra loader field is needed. Scheduling users need read access to this field. The badge uses the standard theme colours; its text and tooltip can be changed in the provider configuration.

{
    "name": "shift-is-vms",
    "condition": {
        "allOrSome": "all",
        "selectors": [
            { "field": "b3s__Is_VMS__c", "operator": "equals", "value": true }
        ]
    },
    "icon": { "svg": "<span class='badge badge-xs badge-info'>VMS</span>" },
    "title": { "literal": "VMS shift" }
}

Matcher colours and the design system. topBorder, background and any other matcher that returns a class name emit standard utility colour classes (bg-emerald-200, border-t-amber-600 and so on) at runtime. The full colour palette is available to these matchers. The scheduler's own chrome (header, sidebars, filters panel, modals and the calendar grid) is painted from the --ui-* design tokens and follows the component's theme-type, which is light or dark.

eventAlerts (compliance rollup)

eventAlerts binds the event to its compliance alert records (b3s__Event_Alert_V2__c): the count, category, details, severity and points fields, plus the flag marking manually created alerts. This is what renders the compliance badge and penalty count on a shift.

Move, cancel, edit, clone and delete restrictions

Five arrays gate drag and drop and lifecycle actions with human readable reasons:

Array Blocks
moveRestrictions Dragging (for example a cancelled demand cannot be moved). Change shift times in the editor; calendar resizing is disabled.
cancelRestrictions Cancelling.
editRestrictions Opening the edit drawer (a cancelled shift is read only).
cloneRestrictions Cloning.
deleteRestrictions Deleting (a cancelled shift cannot be deleted).

Each restriction has a type (for example warning), a message and a condition. Companion state conditions isCancelled and isReadOnly classify the record for the UI.

Compliance restrictions

From 12.5.0, configure schedulables.shift.complianceRestrictions to restrict selected field values on shifts with blocking alerts and selected actions while checks run. These controls apply in the Scheduler. See Scheduler compliance restrictions for setup, permissions and limits.

Demand sync and flush arrays

Three arrays keep demands, their child shifts, reassignment and cloning consistent:

Key features

Shifts versus demands

Both are the same object, b3s__Shift__c. A demand is a shift row with no contact and a b3s__Required_Staff__c count. It is an open headcount placeholder rather than an assignment. Staffing a demand does not assign the demand itself; it creates a per worker child shift linked back through demandParentFieldPath, and the demand's remaining count reflects what is still open. Demands are never checked for compliance, only the real per worker shifts are. The demand sync and flush arrays above keep a demand and its children aligned.

Compliance evaluation

Compliance runs client side against the loaded events, using dynamic rules stored as b3s__Scheduling_Compliance_Rule__mdt records. The package ships rules for worker status, tickets, double booking, maximum daily hours, availability, distance, suitability and breaks. Results surface as the eventAlerts badge on each shift. Full authoring guide: Scheduling compliance rules.

Shift matching

The auto match engine reads the shift schedulable's matchingLoaders, refreshes those loaders, and drives a confirm matches wizard against open and unmatched shifts, applying the compliance rules as it evaluates each candidate. Matching can run shift to candidate or candidate to shift.

Saving and live sync

Calendar changes save in the background as all or nothing transactions (up to the WFM setting Upsert Batch Size, default 200, per transaction). Only changed fields are written, a failed save snaps the tiles back with one toast, and the header shows Saving… / All changes saved. Every syncTimeout seconds (default 15) the calendar merges other users' edits, new shifts and deletions in place, without reloading and without touching tiles that are still saving; disablePooling: true turns this off. Copy, cut, paste and delete have keyboard shortcuts (Ctrl/Cmd + C, X, V, A, Delete, Escape) and Shift + click selects a range. Full reference: Scheduler saving and live sync.

Filters panel

The filters panel is driven by b3s__Scheduling_Filter__mdt records, loaded org wide independently of the context provider JSON. See Scheduling filters and advanced filtering.

Per day stats

Enable daily totals with schedulables.shift.dayStats. The scheduler shows coverage (assigned/total) plus configurable status counts, sums and conditional counts under each day in the column header, recalculated on every filter run. See Scheduler per day stats.

The totals under each worker in a resource timeline use the Scheduler translation keys resourceStats.shifts, resourceStats.scheduled and resourceStats.actual. These totals follow the visible shifts as you filter the calendar. Translate the worker totals

Special dates

b3s__Scheduling_Special_Date__mdt records define org holidays and blackout dates, rendered as background highlights on the grid. They are queried non critically, so a failure does not block boot.

Bulk notification engine

Gated by the definition's notifications root key. When enabled it surfaces a Send notification action on multi selected shifts and a Notification Center panel for reviewing, editing and sending per recipient messages across channels. See Scheduling notifications.

Loaders

The scheduler fetches supporting data (contacts, certificates, sites, jobs, working patterns) through the provider's b3s__Loaders__c JSON array. Legacy loader records matched by object/group name remain supported during migration. Loader queries are defined in JSON and run entirely server side; the client only ever receives loader descriptors and paginated result pages. Loaders feed the resource rows, the record form pickers, and the matching engine. See Data loaders for the JSON contract, placeholders and batching.

Org setup

Version 11 matching review

Group matching separates available and blocked candidates, summarises their issues and lets you inspect results for each shift. A blocked candidate's details explain which shifts prevent assignment.

Matching percentages now combine absolute fit with relative ranking. Review thresholds and custom rules after upgrading; see Scheduling compliance rules for maxPoints and absoluteScoreWeight.