When a client (or the master vendor) approves a worker proposal on a booking request, the package creates the placement (Working Pattern) and then generates two PDF documents in the background:
| Kind | Default content | Typical recipient |
|---|---|---|
| Client booking confirmation | Worker photo, first and last name, supplying vendor, placement dates, client / job / site, and every credential attached to the accepted proposal (credential, number, valid from, valid until, approval status). When the vendor attached none, all of the worker's credentials are listed except Rejected and Revoked ones | The client contact. This replaces the hand-built "compliance checklist" document many agencies attach today. |
| Provider booking (assignment) confirmation | Worker, vendor, client, job, start, end, PO number, site, site location, address and the working pattern days (week, day, start, end, rate basis) | The worker or the supplying agency. This is the "assignment confirmation" used in education and US healthcare staffing. |
Shift proposals (single shifts and demand children) do not produce confirmations. Only placements do.
Automatic generation is off by default. Turn it on in Setup > Custom Settings > WFM (b3s__Scheduler__c) > Manage > Booking Confirmations Enabled (b3s__Booking_Confirmations_Enabled__c). It is a hierarchy setting, so it can be enabled for the org or for specific profiles or users (the approving user's value counts). The setting only controls generation on approval: the Regenerate Booking Confirmation quick action and the Generate Booking Confirmation action always work.
b3s__Booking_Confirmation__e) for the new placement. The event is published after commit, so a rolled-back approval never produces a document.| Field (Working Pattern) | Meaning |
|---|---|
Client Confirmation Document Id (b3s__Client_Confirmation_Document_Id__c) |
ContentDocument Id (069...) of the client PDF |
Client Confirmation Last Generated (b3s__Client_Confirmation_Generated__c) |
When the client PDF was last generated |
Provider Confirmation Document Id (b3s__Provider_Confirmation_Document_Id__c) |
ContentDocument Id of the provider PDF |
Provider Confirmation Last Generated (b3s__Provider_Confirmation_Generated__c) |
When the provider PDF was last generated |
Confirmation Error (b3s__Confirmation_Error__c) |
The last failure per kind (missing template, render error). Cleared by the next clean run. |
The fields are on the Working Pattern page layout in the Booking Confirmations section.
The render job runs as the running user of the BookingConfirmationTrigger subscription. By default that is the Automated Process user, which Visualforce refuses ("You do not have sufficient privileges to access the controller"). Set a licensed user once per org (for example an admin or integration user holding the WFM Admin permission set):
BookingConfirmationTrigger.Until this is done every run writes the instructions above into Confirmation Error on the placement.
Install WFM 12.9.0 in the target org first so the Booking Confirmation event and trigger exist. If the trigger already has a subscriber configuration in that org, update the existing configuration using its metadata name.
From a Salesforce DX project, save the following example as force-app/main/default/platformEventSubscriberConfigs/BookingConfirmationSubscriber.platformEventSubscriberConfig-meta.xml. The Version 12 release samples include the same file (booking-confirmation-subscriber.platformeventsubscriberconfig-meta.xml).
<?xml version="1.0" encoding="UTF-8"?>
<PlatformEventSubscriberConfig xmlns="http://soap.sforce.com/2006/04/metadata">
<platformEventConsumer>b3s__BookingConfirmationTrigger</platformEventConsumer>
<user>admin@yourorg.example</user>
<masterLabel>Booking Confirmation Subscriber</masterLabel>
</PlatformEventSubscriberConfig>
Replace admin@yourorg.example with the exact username of an active, licensed user in the target org. From the project root, deploy the file. Replace wfm-sandbox with your authenticated target org alias.
sf project deploy start --source-dir force-app/main/default/platformEventSubscriberConfigs/BookingConfirmationSubscriber.platformEventSubscriberConfig-meta.xml --target-org wfm-sandbox
After deployment, return to Setup > Platform Events > Booking Confirmation > Subscriptions. Open Manage next to BookingConfirmationTrigger, suspend and resume the subscription, and verify the running user. On a test placement from an approved proposal, run Regenerate Booking Confirmation and check that both PDFs are linked to the placement and Confirmation Error is blank. See the Salesforce metadata reference.
The running user must be able to read placements, proposals, credentials (b3s__Ticket__c), worker photos and the Visualforce page named by the template. It also owns the generated files.
Templates are records of the custom metadata type Booking Confirmation Template (b3s__Booking_Confirmation_Template__mdt):
| Field | Meaning |
|---|---|
| Label / Name | The template name referenced from the sharing group |
Page Name (b3s__Page_Name__c) |
Visualforce page API name. Use the namespace for packaged pages (b3s__BookingConfirmationClient). Your own pages have no prefix. |
Two templates ship with the package:
| Template | Page |
|---|---|
Client_Default |
b3s__BookingConfirmationClient |
Provider_Default |
b3s__BookingConfirmationProvider |
Templates are assigned per client on the VMS Sharing Group (normally one group per client):
| Field (VMS Sharing Group) | Meaning |
|---|---|
Client Confirmation Template |
DeveloperName of the template for the client PDF. Blank = Client_Default. |
Provider Confirmation Template |
DeveloperName of the template for the provider PDF. Blank = Provider_Default. |
On the VMS Sharing Group record page, the Sharing Group Manager card offers both fields as drop-downs listing every Booking Confirmation Template (label and page), plus Package default. A name that no longer matches a template shows as (not found) so it can be corrected. The same card lists the group's assignments by role (Client, Vendor, Master Vendor, sorted by tier) with Add, Edit and Remove. Each button appears only when you have that permission on VMS Sharing Group Assignment. Assignments with a blank role are listed under No role (ignored), because no pool uses them. The card runs as the signed in user, so their sharing, object and field permissions apply. The page (VMS_Sharing_Group_Record_Page, the default view) also keeps the Assignments related list as a dynamic related list.
Resolution for a placement: the client account is the booking request's Account, else the job's account, else the site's account (the packaged pages print the same account as Client). The package takes the sharing groups where that account has a Client assignment and uses the first group (by group name) that names a template. If no group names one, the default template is used. A template name that does not exist is written to Confirmation Error and the other kind still renders.
To match an existing document (for example a compliance checklist with brand logos and specific checks per credential type), create your own Visualforce page and controller in your org:
The Version 12.9.0 release samples include example confirmation pages and their Salesforce metadata files. If you copy the examples, give the controller and pages your own names and update each page's controller attribute to match your controller class.
id URL parameter: /apex/YourPage?id=<Working Pattern Id>.renderAs="pdf". The package calls getContentAsPDF().b3s__Contact__c), the accepted proposal (b3s__Worker_Proposal__c where b3s__Converted_Working_Pattern__c = the placement), the credentials the vendor attached (b3s__Ticket_Ids__c, comma-separated Ticket Ids, blank = all of the worker's credentials), and the worker photo (Contact.b3s__Worker_Photo_Id__c, see Worker photos).Page Name is your page.Photos in a PDF page: use /sfc/servlet.shepherd/version/download/<ContentVersion Id> for uploaded photos and /servlet/servlet.FileDownload?file=<Attachment Id> for migrated ones, as the packaged page does.
The global invocable action Generate Booking Confirmation (category VMS, Apex class b3s.BookingConfirmationService) queues a new version:
| Input | Required | Meaning |
|---|---|---|
| Placement Id | Yes | The Working Pattern Id |
| Kind | No | Client, Provider, or blank for both |
The placement page has a Regenerate Booking Confirmation quick action (screen flow Regenerate_Booking_Confirmation: client, provider or both) that calls this action.
Use it from a record-triggered flow on b3s__Ticket__c (for example when Approval Status, Valid Until or Credential Number changes) to regenerate the confirmations of that worker's current placements, or from a screen flow / quick action on the Working Pattern. The action returns immediately. The PDF is rendered asynchronously by the subscriber user, so it can be called by portal guests (for example a Vendor Portal credential update) too. An invalid Id or kind fails the flow with a clear message.
Apex callers can use the same action:
b3s.BookingConfirmationService.Request request = new b3s.BookingConfirmationService.Request();
request.placementId = placementId;
request.kind = 'Client';
b3s.BookingConfirmationService.generate(new List<b3s.BookingConfirmationService.Request>{ request });
Two flows ship inactive, so upgrades never start emailing anyone by surprise. Activate them, or clone them and adapt the recipient, wording or trigger:
| Flow | Runs when | Sends to |
|---|---|---|
| Send Client Booking Confirmation | Client Confirmation Last Generated is set for the first time on a placement |
The client contact who broadcast the request (Vendor Invite > Invited By Client Contact), if they have an email |
| Send Provider Booking Confirmation | Provider Confirmation Last Generated is set for the first time |
The placed worker, if they have an email |
Both attach the latest version of the PDF, log the email against the placement, and do not re-send on regeneration. They stop without an error when there is no converted proposal (for example a manually created placement), no recipient with an email, or no file. A placement update that fails (for example a faulting customised flow) is written to Confirmation Error and does not affect other placements in the same run. To re-send updated documents, remove the "First Generation" decision. To confirm to the supplying agency instead of the worker, point the provider flow's recipient at a vendor contact.
Once the client PDF exists, the accepted proposal card (Proposals tab and request console) shows a Booking confirmation button that downloads the PDF.
Configuration (Client Shift Manager definition, schedulables.proposal):
"confirmationDocumentFieldPath": "b3s__Converted_Working_Pattern__r.b3s__Client_Confirmation_Document_Id__c"
Add the same path to the fieldToLoad of the proposals loader (vmsProposals in the sample configuration). The button only shows when the path is configured and has a value.
The download goes through b3s.BookingConfirmationService endpoint getClientConfirmation:
Request:
{ "controllerName": "b3s.BookingConfirmationService", "endp": "getClientConfirmation", "proposalId": "a0X..." }
Response: the PDF as a raw base64 string on success (the same shape as the invoice PDF download), otherwise an error response:
{ "success": false, "message": "No booking confirmation is available yet." }
Access rules, enforced server-side:
No extra User Profile checkbox is needed: anyone who can see the proposal can download its confirmation.
The Booked workers list on the Client Shift Manager Workers tab shows a Booking confirmation button on each placement whose client PDF exists. It calls the same endpoint with a placementId instead of a proposalId:
{ "controllerName": "b3s.BookingConfirmationService", "endp": "getClientConfirmation", "placementId": "a0Y..." }
The response is the same. With placementId, the placement's job or site account must be one of the contact's accounts granting Tab Workers (b3s__Tab_Workers__c), and the file must still be linked to the placement. The button needs confirmationDocumentFieldPath on the bookedPlacement schedulable:
"confirmationDocumentFieldPath": "b3s__Client_Confirmation_Document_Id__c"
| Symptom | Check |
|---|---|
| Fields stay blank after approval | Booking Confirmations Enabled is off (see Turning it on). Otherwise Confirmation Error on the placement and Setup > Apex Jobs (BookingConfirmationService). |
Booking confirmations need a running user ... |
The subscription still runs as Automated Process. Configure the running user, then suspend and resume the subscription. |
Booking confirmation template [X] not found |
The sharing group names a template DeveloperName that does not exist, or its Page Name is blank. |
| PDF renders without a photo | The subscriber user cannot read the worker's photo file. |
| The client sees no button | confirmationDocumentFieldPath missing from the definition or the loader's fieldToLoad, or the client PDF has not been generated yet. |