VMS request stage, cancellation and edit locking

Every VMS request (a demand Shift or a Booking Request) carries a VMS Stage. It tells clients, vendors and reports at a glance where the request is: still a draft, out with vendors, receiving proposals, filled, gone stale or canceled. The stage also decides whether a client may still edit the request.

The stage

b3s__VMS_Stage__c is a formula (Text) on b3s__Shift__c and b3s__Booking_Request__c. It is evaluated top to bottom; the first match wins.

Stage When Badge colour
Canceled VMS Cancellation Reason has a value Red
Complete Shift: a Contact is assigned to the shift itself (a filled single shift), or assigned child shifts (Assigned_Shift_Count__c) reach Required Staff. Booking Request: Filled__c is ticked or placements reach Required Staff Green
Stale Either there are proposals, none was placed, and the start has passed (shift: Absolute_Start_Time__c before now; booking request: Start__c today or earlier), or the end has passed without the request filling, with or without invites or proposals (shift: Absolute_End_Time__c before now; booking request: End__c before today) Amber
Proposals There is at least one proposal (any status except Withdrawn and Canceled) Accent
Broadcasting There is at least one vendor invite, no proposals yet Blue
New Default: a VMS request not yet sent to any vendor Grey
(blank) The record is not a VMS request (VMS__c unticked and no invites), for example a regular schedule shift or a child shift created from a proposal

Blank Required Staff counts as 1.

Because Stale depends on the current time, the stage is always up to date without any scheduled job. It can be used in report filters, list views and SOQL WHERE clauses. It cannot be used in GROUP BY or report groupings by Salesforce rule (time based formulas are not groupable); group by the counter fields below instead, or bucket in the report.

Counter fields

The stage reads trigger maintained counters. They update whenever an invite or proposal is created, deleted, restored, re-pointed or changes status. They are read only for every portal session.

Field On Counts
b3s__VMS_Invite_Count__c Shift, Booking Request Vendor invites with a vendor account (internal placeholder invites are ignored)
b3s__VMS_Proposal_Count__c Shift, Booking Request Worker proposals in any status except Withdrawn and Canceled
b3s__VMS_Placed_Count__c Booking Request Proposals with status Converted (placements made)

Shifts use the existing b3s__Assigned_Shift_Count__c for placements.

On upgrade the package recounts every request that already has invites in a background job, so existing requests show the right stage.

Action priority

Two Number formulas turn the stage into a sort key for the server-paged request and invite lists: lower means "needs action sooner". They are read only (no portal or user can write them).

b3s__VMS_Action_Priority__c on Shift and Booking Request repeats the stage branches in the same order, so it always agrees with the stage:

Priority Stage Why it sorts here
1 New, with Requisition_Approval_Status__c = Pending Approval Waiting for the client's own approver
2 Proposals Workers to review
3 Stale Missed coverage to resolve
4 New (also records that are not VMS requests) Ready to broadcast
5 Broadcasting Waiting on vendors
6 Complete Nothing to do
7 Canceled Nothing to do

b3s__Vendor_Action_Priority__c on Vendor Invite orders the vendor's invites:

Priority Invite
1 Status New or Seen, not expired
2 Status Queried, not expired
3 Status Accepted (an accepted invite keeps 3 after b3s__Expires__c passes: the vendor still has to propose)
9 b3s__Expires__c passed before an answer, or any other status (Rejected, Released, Canceled ...)

Like the stage, both depend on the current time: they can be filtered and sorted in reports and SOQL, not grouped, and a sort on them cannot use an index. Field level security: read access in WFM Admin, WFM VMS Client User (request priority) and WFM VMS Vendor User (both).

SELECT Id, Name, b3s__VMS_Stage__c, b3s__VMS_Action_Priority__c
FROM b3s__Shift__c
WHERE b3s__VMS__c = true
ORDER BY b3s__VMS_Action_Priority__c, b3s__Absolute_Start_Time__c

Canceling a request

Canceling sets VMS Cancellation Reason (b3s__VMS_Cancellation_Reason__c, restricted picklist) and optionally VMS Cancellation Comments (b3s__VMS_Cancellation_Comments__c). Any reason makes the stage Canceled; clearing it reopens the request.

Shipped reasons: Wrong Details, Coverage no longer needed, User Error, Canceled by Vendor, Other.

A canceled request:

Cascading to invites and proposals

Two checkboxes on the WFM custom setting (b3s__Scheduler__c, Setup > Custom Settings > WFM > Manage) control whether canceling also closes the request's open invites and proposals. Both are off by default.

Field Label When checked
b3s__Auto_Cancel_Vendor_Invites__c Auto-Cancel Vendor Invites Every invite in New, Seen, Accepted or Queried is set to Canceled
b3s__Auto_Cancel_Worker_Proposals__c Auto-Cancel Worker Proposals Every proposal in Proposed, Requested or Client Review is set to Canceled

The setting is a hierarchy setting, so it can be set per profile or user; the value of the user who saves the cancellation applies (for portal cancellations, the site guest user's profile, else the org default).

With both checkboxes off, open invites stay as they are and vendors see the Canceled badge. Release them from the broadcast panel if vendors should drop off.

Permissions

Four checkboxes on User Profile (b3s__User_Profile__c) control what a client may do once a request is submitted. Submitted means the VMS Stage is past New: the request has been broadcast, has proposals, is complete, stale or canceled.

Field Label Grants
b3s__Edit_Submitted_Shift_Requests__c Edit Submitted Shift Requests Edit or delete a shift request after submission, until it is Complete
b3s__Edit_Submitted_Booking_Requests__c Edit Submitted Booking Requests Edit or delete a booking request after submission, until it is Complete
b3s__Cancel_Submitted_Shift_Requests__c Cancel Submitted Shift Requests Cancel a shift request (cancellation fields only)
b3s__Cancel_Submitted_Booking_Requests__c Cancel Submitted Booking Requests Cancel a booking request (cancellation fields only)

Manage Shift Requests and Manage Booking Requests keep creating requests and editing or deleting them while they are New. Without the Edit Submitted permission the Edit button disappears as soon as the first vendor is invited, and the server rejects the save.

Upgrade note. Before this release Manage Shift / Booking Requests also allowed editing broadcast requests. Tick the matching Edit Submitted checkbox on any existing profile that should keep that.

The Client Shift Manager now also offers Edit on shift requests (it uses the shift schedulable's recordFormFields, the same form as the request wizard).

Server enforcement

For governed Client Shift Manager sessions (see VMS access profiles):

Object Operations Permission Scope
Shift / Booking Request C Manage Shift / Booking Requests Job or site account
Shift / Booking Request U, D Manage Shift / Booking Requests Job or site account, and the record is not VMS or its stage is New, both before and after the save
Shift / Booking Request U, D Edit Submitted Shift / Booking Requests Job or site account, and the stage is not Complete, both before and after the save
Shift / Booking Request U, fields Id, b3s__VMS_Cancellation_Reason__c, b3s__VMS_Cancellation_Comments__c only Cancel Submitted Shift / Booking Requests Job or site account

Because the New check also runs after the save, Manage alone can never cancel a request (that would move it to Canceled). Cancel Submitted cannot change any other field in the same save.

If you add fields to requestCancelationFields, the save is rejected unless the contact also holds Edit Submitted; the cancel allowlist is packaged. Raise it with 3B support if you need more cancellation fields.

Definition configuration

Client Shift Manager

On both the shift and bookingRequest schedulables:

"vmsStageFieldPath": "b3s__VMS_Stage__c",
"requestCancelationFields": [
    {
        "field": "b3s__VMS_Cancellation_Reason__c",
        "labelOverride": "Cancellation Reason",
        "type": "field-select",
        "required": true,
        "columns": "col-span-2"
    },
    {
        "field": "b3s__VMS_Cancellation_Comments__c",
        "labelOverride": "Comments",
        "type": "field-text-area",
        "required": false,
        "columns": "col-span-2"
    }
]
Key Effect when missing
vmsStageFieldPath No stage badge, and the Edit button falls back to Manage Shift / Booking Requests for every request (the server still enforces the stage rules)
requestCancelationFields No Cancel Request button

The bookingRequests loader must load the stage and the cancellation fields:

"fieldToLoad": [
    "b3s__VMS_Stage__c",
    "b3s__VMS_Cancellation_Reason__c",
    "b3s__VMS_Cancellation_Comments__c"
]

(add them to the existing list). Shift fields are loaded automatically from the schedulable.

Vendor Portal

On the invite schedulable:

"shiftStageFieldPath": "b3s__Shift__r.b3s__VMS_Stage__c",
"bookingStageFieldPath": "b3s__Booking_Request__r.b3s__VMS_Stage__c"

and add both paths to the invites loader's fieldToLoad. Without them the invite cards show no stage badge and canceled requests are not locked in the portal (approval is still blocked on the server).

Request lists

The stage also drives the scope selects on the Client Shift Manager Requests tab (Active, Stale, Filled, Canceled) and the Vendor Portal Invites tab (Open, Won, Lost, Canceled). Requests that have ended leave both lists, except unfilled client requests, which stay under Stale. When the definition declares the root lists key, both lists are paged on the server, sorted by the action priority fields, and gain a Past scope for ended requests. See Client Shift Manager and Vendor Portal.

Translations

Stage labels use the translation keys vms.stage.<Stage> (Client Shift Manager) and stage.<Stage> (Vendor Portal), for example vms.stage.Broadcasting. The button and form header use vms.requests.cancel and vms.requests.cancelHeader.

Report examples

Question Filter
Requests waiting on vendors VMS Stage equals Broadcasting
Requests that need client action VMS Stage equals Proposals
Missed coverage VMS Stage equals Stale
Cancellations by reason VMS Stage equals Canceled, group by VMS Cancellation Reason

SOQL:

SELECT Id, Name, b3s__VMS_Stage__c, b3s__VMS_Proposal_Count__c
FROM b3s__Booking_Request__c
WHERE b3s__VMS_Stage__c IN ('Proposals', 'Stale')

Troubleshooting

The Edit button disappeared from a request. The request has been broadcast (stage past New). Tick Edit Submitted Shift / Booking Requests on the contact's profile for that account.

"Your profile does not allow this change to [b3s__Shift__c] for this account." on cancel. The profile lacks Cancel Submitted for the request's account, or the cancellation form contains a field outside the allowlist.

Invites stayed open after a cancel. Auto-Cancel Vendor Invites is off for the user who canceled (check the org default and any profile or user level row of the WFM custom setting), or the reason was already set before the setting was turned on.

Stage shows New for a request that has invites. The counters were not recounted, for example data loaded with triggers disabled. Re-save one of its invites' proposals with a status change, or contact 3B support to rerun the recount job.