Placement extensions

Placement extensions

Clients often want to keep a worker longer: "James worked for us this week, extend him for two more weeks". A placement extension records that request on the placement itself, keeps a history of every extension, and lets the extended period run on different terms, for example a move from production line 1 to production line 2 or a new rate group.

A placement is a Working Pattern (b3s__Working_Pattern__c) for one worker. An extension is a Booking Extension (b3s__Booking_Extension__c), a master-detail child of the placement. Extensions work the same for VMS and non-VMS placements.

How it works

A placement is a chain of periods that never overlap:

Period Dates Terms
Original placement Start to Original End The placement's own job, site, pattern, rate group, cost center, PO, reason code
Each Approved extension Extension Start to New End The extension's own values

Example: a placement runs 1 to 15 January on Job X, Site Y, Rate Group Z. Extension 1 covers 16 to 31 January on Rate Group Z2. Extension 2 covers 3 to 14 February on Job X2, Site Y2. Shift generation creates three blocks of shifts, each with its own job, site, site timezone and rate group. No shifts are created for 1 and 2 February because they fall in the gap.

On the placement:

Field Meaning
End (End__c) The current end, including approved extensions. Expense matching, timesheets, schedules and portals keep reading this field.
Original End (Original_End__c) The end before the first extension. Stamped automatically.
Extensions (Extension_Count__c) Roll-up: number of Approved extensions.
Last Extension End (Last_Extension_End__c) Roll-up: New End of the latest Approved extension.

Booking Extension fields

Field Notes
Placement (Working_Pattern__c) Required. Master-detail: access follows the placement.
Status (Status__c) Pending (default), Approved, Declined, Withdrawn, Canceled. Everything except Pending is final.
Extension Start (Extension_Start__c) Blank = the day after the placement's current End. Must be after the current End. A later start leaves a gap.
New End (New_End__c) Required. Becomes the placement End on approval.
Previous End (Previous_End__c) Stamped: the placement End when the extension was created.
Booking Request (Booking_Request__c) Stamped from the placement.
Job, Site, Site Location, Working Pattern Type, Rate Group, Rate Basis, Cost Center, PO Number, Reason Code The terms of the extension period. Blank on create = copied from the latest period (latest Approved extension, else the placement, else its booking request). Every extension therefore records the terms it was approved at.
Comments (Comments__c) Free text from the requester.
Awaiting (Awaiting__c) Client, Master Vendor or Vendor: the party that must confirm next. Blank once decided, and blank on a Pending request an internal user decides.
Approval Chain (Approval_Chain__c) The parties that must confirm, in order (for example Client;Vendor), fixed when the request was made through a portal or the VMS panel.
Requested By Role (Requested_By_Role__c) Client, Master Vendor, Vendor, or Internal (record page, Extend Placement, Flow, integration).
Requested By (Account) / (Contact) (Requested_By_Account__c / Requested_By_Contact__c) The requesting account and, for portal users, the contact.
Reviewed By Role / Reviewed Timestamp (Reviewed_By_Role__c / Reviewed_Timestamp__c) The last approval step or decision. Internal when an internal user set the Status directly.
Response Comments (Response_Comments__c) One line per approval, decline or withdrawal, prefixed with the party (for example Vendor: worker available).

Rules

Approving an extension

An extension takes effect when its Status becomes Approved:

  1. The placement is locked, and the approval is refused if the placement End changed since the extension was created (Previous End no longer matches). Withdraw it and create a new one.
  2. Original End is stamped on the first extension.
  3. The placement End moves to New End. A filled booking request's End moves out to New End when it is earlier; an unfilled request keeps its End, so it does not leave Stale and re-open on the portals.
  4. If Auto-Regenerate Placement Shifts is on, the extension period's shifts are generated (see below). When the approving transaction has no capacity left to queue the job (for example a bulk approval from another background job), the extension still applies and the placement's Last Generation Log says to run Generate Shifts.

Ways to request and approve:

Route Result
Extend Placement action on the placement record page Creates the extension already Approved: an immediate extension. Leave terms blank to keep the current ones.
New on the placement's Booking Extensions related list Creates a Pending request with no approval chain. An internal user approves it by setting Status to Approved.
Flow, Approval Process, integration Any process that sets Status to Approved applies the extension the same way.
Client Shift Manager (request, client approval), Vendor Portal (vendor confirmation), Placement Extensions component (master vendor / internal) Through the server endpoints below. The approval chain decides who confirms.

Setting Status directly is the internal override: it works at any point of a chain and stamps Reviewed By Role = Internal.

Confirming for the vendor. When a sub-vendor confirms outside the portal (for example by phone), the master vendor records it on the Placement Extensions component with Approve for vendor / Decline for vendor. Unlike the Status override, this answers only the Vendor step: the chain carries on as if the vendor had answered on the portal, Reviewed By Role = Vendor, and the required note is added to the responses as Vendor: recorded by <user> on behalf of the vendor: <note>. It needs edit access to the placement.

Approval chain

Extensions are the client's request. The client raises them in the Client Shift Manager; the master vendor (or, on a non-VMS placement, an internal user) can raise one on the client's behalf, which skips the client. Vendors never request; they confirm.

When a request comes through the endpoints, the parties that must confirm are fixed on the request, in this order:

  1. Client. Only when a client user requests and their access profile has Requires Requisition Approval for the account: a client approver (Approve_Requisitions__c) confirms first.
  2. Master Vendor. For a VMS placement whose client runs the mediated (MSP) mode (Account.VMS_Workflow_Mode__c, blank = the Client Shift Manager definition's vmsWorkflowMode), the master vendor confirms.
  3. Vendor. For a placement filled by a sub-vendor (the vendor of the converted worker proposal), the vendor confirms the worker is still available when the client account's Extension Requires Vendor Confirmation (Account.Extension_Requires_Vendor_Confirmation__c, default on) is checked. A worker the master vendor supplied itself has no vendor step.
  4. Agency. A client request always ends with someone on the supply side, because the worker may not be available. When neither step 2 nor step 3 applies, the agency confirms: the Master Vendor on a VMS placement, an internal user (Awaiting = Internal) on a non-VMS placement.

A request raised on the client's behalf only has the Vendor step (when step 3 applies), else it applies at once. The chain is fixed when the request is made: changing an account setting later does not change requests already pending.

Requested by Placement Chain
Client VMS, Marketplace, sub-vendor Vendor
Client (profile requires requisition approval) VMS, Marketplace, sub-vendor Client, Vendor
Client VMS, MSP, sub-vendor Master Vendor, Vendor
Client, vendor confirmation off VMS, Marketplace, sub-vendor Master Vendor
Client VMS, master vendor's own worker Master Vendor
Client Non-VMS Internal
Client (profile requires requisition approval) Non-VMS Client, Internal
Master Vendor VMS, sub-vendor Vendor
Master Vendor, vendor confirmation off VMS none: approved at once
Internal user (VMS panel, record page, Flow) Non-VMS or any none

Each approval moves Awaiting to the next party. The last approval sets Status to Approved, which applies the extension (see above). A decline sets Declined. The requester can withdraw while Pending. An empty chain creates the extension Approved straight away. A record created without the endpoints (record page, Flow) has no chain and Requested By Role = Internal.

Who may do what (portals)

Portal users need an access profile (see VMS access profiles). Guests without one are rejected.

Action Client Shift Manager (role Client) Vendor Portal (role Vendor)
Request Request_Extensions__c on the placement's client account (the booking request's account first, else the job or site account) Not allowed
Approve or decline the Client step Approve_Requisitions__c on the client account
Approve or decline the Vendor step Review_Extensions__c on the supplying vendor account
Withdraw Own requests, with Request_Extensions__c on the requesting account

A review is refused when the extension is no longer Pending or is waiting for another party.

Clients only move the end. A portal request never sets the start: the extension always starts the day after the placement's current End (which already includes approved extensions). The form shows that date locked ("props": { "disableStart": true } on the date range field).

Terms a portal requester may set. New End and comments always. Other terms (job, site, rate group and so on) only when they are listed in the app definition's schedulables.extension.recordFormFields (the field list the request form renders, composite start:end fields included). Without that key only the PO Number may change. Anything else is refused. The master vendor (VMS panel) may set every term.

"extension": {
    "recordFormFields": [
        { "field": "b3s__Extension_Start__c" },
        { "field": "b3s__New_End__c" },
        { "field": "b3s__Rate_Group__c" },
        { "field": "b3s__PO_Number__c" },
        { "field": "b3s__Comments__c" }
    ]
}

Reading extensions. Portal loaders and Id reloads may read Booking Extensions under the read rules: the Client Shift Manager reads the extensions of its accounts' placements (placement job or site account, or the booking request's account, IN :accountIds), the Vendor Portal those of placements it supplied (converted proposal of its invites). Portal sessions never write them through the generic record endpoints: every change goes through the endpoints below.

Endpoints

All three are actions of the b3s.VmsPortalService remoting service and take the standard access arguments (appType, sessionKey). See the calling contract. Dates are YYYY-MM-DD strings. Errors come back as the standard error response with a readable message.

requestExtension

{
    "endp": "requestExtension",
    "workingPatternId": "a0X...",
    "newEnd": "2030-01-31",
    "terms": { "b3s__PO_Number__c": "PO-2041" },
    "comments": "Keep James two more weeks"
}
{ "success": true, "responseObject": { "extensionId": "a1B...", "status": "Pending", "awaiting": "Vendor" } }

reviewExtension (reviewAction: approve or decline)

{ "endp": "reviewExtension", "extensionId": "a1B...", "reviewAction": "approve", "comments": "Worker available" }
{ "success": true, "responseObject": { "extensionId": "a1B...", "status": "Approved", "awaiting": null } }

withdrawExtension

{ "endp": "withdrawExtension", "extensionId": "a1B...", "comments": "No longer needed" }
{ "success": true, "responseObject": { "extensionId": "a1B...", "status": "Withdrawn", "awaiting": null } }

Master vendor and internal users work in the native Placement Extensions component. They raise a request on the client's behalf (role Master Vendor on a VMS placement, else Internal), approve or decline the agency step (Awaiting Master Vendor or Internal), and withdraw a Pending request they raised. All of these need edit access to the placement.

Screens

Client Shift Manager, Extensions tab. Shown when the definition has an extension schedulable and the user holds Request Extensions or Approve Requisitions. Non-VMS portals embed it alone with ?tab=extensions.

Vendor Portal, Extensions tab. Shown with an extension schedulable and Review Extensions. It lists the extensions of placements the vendor supplied, with Approve / Decline when awaiting Vendor. There is no request button. Badge extensions: Pending requests awaiting Vendor.

Placement Extensions component (native placementExtensions, master vendor and internal users).

VMS Observation Utility (utility bar). Extensions of VMS placements (the booking request has Is VMS selected, or the extension awaits Master Vendor) show as Extension rows next to the requisitions, grouped by client. A Pending extension awaiting Master Vendor is flagged Approve, counted in the header badge and highlights the utility bar item, so the master vendor sees a client request before it is handed to the sub-vendor. These rows show however old they are; other extensions show while touched in the last 7 days. Open the row to review on the placement.

Requests created with New on the related list wait for nobody. An internal user decides them by setting Status; they appear only under scope pending.

Definition keys

The Version 12 release samples include Client Shift Manager and Vendor Portal configurations with these keys.

Key App Meaning
schedulables.extension CSM, VP objectType b3s__Booking_Extension__c, loaderName extensions; field paths placementFieldPath, workerNameFieldPath, statusFieldPath, awaitingFieldPath, requestedByRoleFieldPath, requestedByContactFieldPath, extensionStartFieldPath, newEndFieldPath, commentsFieldPath; title card fields; CSM accountFieldPaths and recordFormFields (the request form, also the server's term allowlist)
schedulables.extensionPlacement CSM objectType b3s__Working_Pattern__c, loaderName extensionPlacements, accountFieldPaths, workerNameFieldPath, jobFieldPath (seeds runtime $jobId for showOptionIf), endFieldPath (current End; the form's start shows End + 1), title
Loader extensions CSM Extensions of placements whose booking request account, else job account, else site account is IN :accountIds (created in the last 365 days)
Loader extensionPlacements CSM Placements with a worker, End__c in the last 30 days or later, same account split on :accountIds(b3s__Request_Extensions__c)
Loader extensions VP Placements converted from proposals on the vendor's invites, :accountIds(b3s__Review_Extensions__c)
Badge extensions CSM, VP Pending, awaiting Client (:accountIds(b3s__Approve_Requisitions__c)) or Vendor

The CSM loader names must stay extensions / extensionPlacements: the manager registers them by name.

Generating the extension's shifts

Two WFM settings (b3s__Scheduler__c custom setting) control automatic generation:

Setting Effect
Auto-Generate Placement Shifts (Auto_Generate_Placement_Shifts__c) When a VMS proposal on a booking request is approved, the new placement's shifts are generated. Does not apply to extensions.
Auto-Regenerate Placement Shifts (Auto_Regenerate_Placement_Shifts__c) When an extension is approved, shifts are generated in Delta mode from the later of Extension Start and today, to New End. Default off.

Leave Auto-Regenerate off when your org runs its own logic after approval, for example a record-triggered Flow on b3s__Booking_Extension__c when Status__c changes to Approved, or the standard Generate Shifts flow on the placement.

Generation (Create, Regenerate and Delta) always follows the periods:

Which fields generated shifts copy

The custom metadata type Placement Shift Field (b3s__Placement_Shift_Field__mdt) lists the Shift fields filled from the placement, extension and booking request. For each row, a shift in an extension period takes the extension value, else the placement value, else the booking request value. A shift in the original period takes the placement value, else the booking request value. The same rows decide which extension fields are copied from the latest period when left blank.

Field Meaning
Shift Field (Shift_Field__c) API name of the Shift field to fill.
Placement Field (Placement_Field__c) API name on Working Pattern. Blank = not read from the placement.
Extension Field (Extension_Field__c) API name on Booking Extension. Blank = extension periods use the placement value.
Booking Request Field (Booking_Request_Field__c) API name on Booking Request, used when the placement (and extension) value is blank.
Active (Active__c) Untick to stop copying the field. With no active record left, the built-in list applies again.

No records = built-in fields. The package ships no Placement Shift Field records. While your org has no active record, generation copies the built-in list below (the same fields it always copied). As soon as you create any active record, only your records are used: re-create the built-in rows you still want.

Built-in Shift field Placement Extension Booking request
Job b3s__Work_Job__c b3s__Job__c b3s__Job__c b3s__Job__c
Site b3s__Work_Site__c b3s__Site__c b3s__Site__c b3s__Site__c
Site location b3s__Work_Site_Location__c b3s__Site_Location__c b3s__Site_Location__c b3s__Site_Location__c
PO number b3s__PO_Number__c b3s__PO_Number__c b3s__PO_Number__c b3s__PO_Number__c
Reason code b3s__Reason_Code__c b3s__Reason_Code__c b3s__Reason_Code__c b3s__Reason_Code__c
Cost center b3s__Cost_Center__c b3s__Cost_Center__c b3s__Cost_Center__c b3s__Cost_Center__c
Rate group b3s__Rate_Group__c b3s__Rate_Group__c b3s__Rate_Group__c b3s__Rate_Group__c
Rate basis b3s__Rate_Basis__c b3s__Rate_Basis__c b3s__Rate_Basis__c b3s__Rate_Basis__c

Leave out Job or Site only deliberately: the shift account falls back to the period job's account, and the shift timezone to the period site.

To copy one of your own fields, add the same field to Shift, Working Pattern and (optionally) Booking Extension and Booking Request, re-create the built-in rows you need, then add a row, for example:

Field Value
Label Shift Notes
Shift Field Shift_Notes__c
Placement Field Shift_Notes__c
Extension Field Shift_Notes__c
Booking Request Field Shift_Notes__c
Active checked

Rules for rows:

These fields are always set by the product, not by the mapping: contact, placement, scheduled times, account, VMS flag, Status (Confirmed for VMS placements), Supplier Account, Supplier Account Tier, and the Working Pattern Day's Rate Basis when no mapped Rate Basis is set.

Values copied when an extension is created

Blank terms on a new extension are copied from the latest period without re-checking them. Rate Basis and Reason Code values you type are validated as on shifts. An extension created while an older placement value (for example a deactivated reason code) is in place therefore still saves.

Upgrading existing orgs

Page layouts are not upgraded in subscriber orgs. After upgrading, add the Request Extensions and Review Extensions checkboxes to your User Profile layout, the Booking Extension approval fields to its layout, the Booking Extensions related list, the Extend Placement action and the Original End, Extensions and Last Extension End fields to your Working Pattern layout, and grant the new objects and fields in your own permission sets if you do not use WFM Admin.

Permissions

The WFM Admin permission set grants Booking Extension create, read, edit and delete, edit access to its term fields, read access to Previous End, Booking Request, Original End, Extensions, Last Extension End and the approval fields (Awaiting, Approval Chain, Requested By, Reviewed By, Response Comments, all set by the server), and edit access to the two Account extension settings and the two User Profile checkboxes. Booking Extension sharing is controlled by the placement.

Troubleshooting

Message Cause
The extension must start after the placement's current End Extension Start is on or before the placement End.
This placement already has a Pending extension Decide the open request first.
The placement End has changed since this extension was requested Someone edited the placement End after the request. Withdraw it and create a new one.
The extension's job must belong to the placement's client account Pick a job of the same client.
This extension is Approved and can no longer be changed Decisions are final. Create a new extension instead, or ask a user with Edit_Decided_Extensions to correct it.
This extension is waiting for Vendor, not for you Another party confirms first. Awaiting shows who.
Your profile does not allow requesting extensions for this placement The user's profile lacks Request Extensions on the client account, or the vendor did not supply this placement.
The field ... cannot be set on an extension request The term is not in the definition's schedulables.extension.recordFormFields, or it is set by the server.
No shifts after approval Auto-Regenerate Placement Shifts is off, or the extension ended before today. Run Generate Shifts on the placement.
Last Generation Log starts with "Placement Shift Field ..." A mapping row is invalid. Fix or deactivate it and run Generate Shifts again.