Add opt-in waitlist feature - #653
jedwardsclarus wants to merge 1 commit into
Conversation
Adds a per-Instance Enable_Waitlist__c checkbox. When enabled, the registration form stays open past capacity, overflow submissions land as Waitlisted with a position number displayed on the confirmation page, and seated cancellations auto-promote the oldest waitlister to Registered (FIFO). New: - Field: Summit_Events_Instance__c.Enable_Waitlist__c (checkbox, defaults false) - Flow Waitlist_When_At_Capacity (before-save, Create): guard for non-wizard insert paths — flips Registered/Pre-Registered to Waitlisted when Instance is full AND Enable_Waitlist is true - Flow Waitlist_Auto_Promote (after-save, Update): when a Registered/Attended/Pre-Registered record transitions to Cancelled, promotes the oldest Waitlisted on the same Instance (sorted by CreatedDate) to Registered - WaitlistTrackerController + waitlistTracker LWC: drop-in Lightning component for the Instance record page that shows all registrations bucketed by status (Attended / Registered / Pre-Reg / Waitlisted / Cancelled), numbers the waitlist 1..N, and exposes Check In, Cancel, Promote to Registered, and Reinstate actions Modified: - SummitEventsShared.isEventClosed: additive Enable_Waitlist bypass on the capacity gate — when the flag is false or null, the existing close-at-capacity behavior is preserved exactly - SummitEventsConfirmationController: adds a Waitlisted branch to the status stamp in checkEventDetails() (also gated on Enable_Waitlist + full capacity), a waitlistPosition property, and a getWaitlistPosition method on the inner registrationCRUD class - SummitEventsReadShared.getInstanceById + SummitEventsFeed.getEventList: add Enable_Waitlist__c to their Instance SELECT so the new gate in isEventClosed doesn't throw an SObjectException - Count_of_Attendees__c summary filter: adds Pre-Registered to the included statuses so this rollup matches its sibling Primary_Attendees__c and pre-reg holds count against capacity math consistently Backward compatibility: every behavioral change is gated by Enable_Waitlist__c (default false). Instances that never check the box behave identically to master. Contributed by San Francisco Bay University. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks for the contribution! Before we can merge this, we need @jedwardsclarus to sign the Salesforce Inc. Contributor License Agreement. |
There was a problem hiding this comment.
🟡 Changes recommended
Missing restricted-picklist values and several gating, capacity, FIFO, permission, and UI integration defects prevent the feature from working reliably.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds opt-in waitlisting, automatic promotion, confirmation positioning, and an attendee-management component.
Changes:
- Adds waitlist configuration and capacity behavior.
- Adds automated waitlisting and FIFO promotion flows.
- Adds an attendee tracker LWC, Apex controller, and tests.
File summaries
| File | Description |
|---|---|
Enable_Waitlist__c.field-meta.xml |
Defines the instance toggle. |
Count_of_Attendees__c.field-meta.xml |
Counts pre-registrations toward capacity. |
waitlistTracker.js-meta.xml |
Exposes the tracker on Instance pages. |
waitlistTracker.js |
Handles tracker data and actions. |
waitlistTracker.html |
Renders status buckets and controls. |
Waitlist_When_At_Capacity.flow-meta.xml |
Waitlists overflow registrations. |
Waitlist_Auto_Promote.flow-meta.xml |
Promotes waitlisted registrations. |
WaitlistTrackerController.cls-meta.xml |
Defines controller metadata. |
WaitlistTrackerController.cls |
Implements tracker queries and actions. |
WaitlistTrackerController_TEST.cls-meta.xml |
Defines test metadata. |
WaitlistTrackerController_TEST.cls |
Tests tracker behavior. |
SummitEventsShared.cls |
Keeps waitlist-enabled events open. |
SummitEventsReadShared.cls |
Queries the waitlist flag. |
SummitEventsFeed.cls |
Selects the waitlist flag for feeds. |
SummitEventsConfirmationController.cls |
Assigns waitlist status and position. |
Review details
Suppressed comments (3)
force-app/main/default/lwc/waitlistTracker/waitlistTracker.html:75
- This anchor has no
href, so it is not keyboard-focusable or activatable as a link. Use a real href (or a Lightning navigation component) so keyboard and assistive-technology users can open the registration.
<a data-url={entry.regRecordUrl} onclick={handleContactClick} style="font-size: 12px; font-weight: 600; color: #1a365d; text-decoration: none; cursor: pointer;">{entry.contactName}</a>
force-app/main/default/lwc/waitlistTracker/waitlistTracker.html:99
- This anchor has no
href, so it is not keyboard-focusable or activatable as a link. Use a real href (or a Lightning navigation component) so keyboard and assistive-technology users can open the registration.
<a data-url={entry.regRecordUrl} onclick={handleContactClick} style="font-size: 12px; font-weight: 600; color: #1a365d; text-decoration: none; cursor: pointer;">{entry.contactName}</a>
force-app/main/default/lwc/waitlistTracker/waitlistTracker.html:127
- This anchor has no
href, so it is not keyboard-focusable or activatable as a link. Use a real href (or a Lightning navigation component) so keyboard and assistive-technology users can open the registration.
<a data-url={entry.regRecordUrl} onclick={handleContactClick} style="font-size: 12px; font-weight: 600; color: #1a365d; text-decoration: none; cursor: pointer;">{entry.contactName}</a>
- Files reviewed: 15/15 changed files
- Comments generated: 20
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| eventRegistration.Status__c = 'Waitlisted'; | ||
| } else { | ||
| eventRegistration.Status__c = 'Registered'; | ||
| } |
| @AuraEnabled(cacheable=true) | ||
| public static List<WaitlistEntry> getWaitlist(Id instanceId) { |
| <assignToReference>$Record.Status__c</assignToReference> | ||
| <operator>Assign</operator> | ||
| <value> | ||
| <stringValue>Waitlisted</stringValue> | ||
| </value> |
| <leftValueReference>Get_Instance.Current_Available_Capacity__c</leftValueReference> | ||
| <operator>LessThanOrEqualTo</operator> | ||
| <rightValue> | ||
| <numberValue>0.0</numberValue> | ||
| </rightValue> |
| if (eventInstance != null && eventInstance.Enable_Waitlist__c == true | ||
| && eventInstance.Current_Available_Capacity__c != null | ||
| && eventInstance.Current_Available_Capacity__c <= 0) { |
| <field>Status__c</field> | ||
| <value> | ||
| <stringValue>Registered</stringValue> | ||
| </value> | ||
| </inputAssignments> |
| <filterFormula>ISPICKVAL({!$Record.Status__c}, "Cancelled") | ||
| && (ISPICKVAL({!$Record__Prior.Status__c}, "Registered") || ISPICKVAL({!$Record__Prior.Status__c}, "Attended") || ISPICKVAL({!$Record__Prior.Status__c}, "Pre-Registered"))</filterFormula> |
| <field>Summit_Events_Registration__c.Status__c</field> | ||
| <operation>equals</operation> | ||
| <value>Registered, In Progress, Confirmed, Attended, No-Show</value> | ||
| <value>Registered, Pre-Registered, In Progress, Confirmed, Attended, No-Show</value> |
| <fullName>Enable_Waitlist__c</fullName> | ||
| <defaultValue>false</defaultValue> | ||
| <description>Master toggle for waitlist on this Instance. When checked, the registration wizard stays open past capacity and overflow registrations are automatically stamped as Waitlisted. When unchecked, the wizard closes at capacity (upstream default). Works in both pre-reg and reg windows when enabled.</description> | ||
| <inlineHelpText>Check to allow the form to accept registrations past capacity and route them to the waitlist. Uncheck to close the form when capacity is reached. Requires Capacity to be set.</inlineHelpText> | ||
| <label>Enable Waitlist</label> |
| <div key={entry.id} class="slds-grid slds-grid_vertical-align-center" style="padding: 6px 8px; background: #f0faf0; border-radius: 6px; margin-bottom: 4px;"> | ||
| <div style="width: 7px; height: 7px; border-radius: 50%; background: #1b5e20; flex-shrink: 0; margin-right: 8px;"></div> | ||
| <div style="flex: 1; min-width: 0;"> | ||
| <a data-url={entry.regRecordUrl} onclick={handleContactClick} style="font-size: 12px; font-weight: 600; color: #1a365d; text-decoration: none; cursor: pointer;">{entry.contactName}</a> |
Adds a per-Instance Enable_Waitlist__c checkbox. When enabled, the registration form stays open past capacity, overflow submissions land as Waitlisted with a position number displayed on the confirmation page, and seated cancellations auto-promote the oldest waitlister to Registered (FIFO).
New:
Modified:
Backward compatibility: every behavioral change is gated by Enable_Waitlist__c (default false). Instances that never check the box behave identically to master.
Contributed by Jeremiah Edwards at Clarus Group
Critical Changes
None. Every change is gated by Enable_Waitlist__c (defaults false), so instances that don't check the box behave identically to master.
Changes
New per-Instance Enable_Waitlist__c field (default false) that turns on waitlist behavior for that Instance
Two flows: Waitlist_When_At_Capacity (before-save guard for non-wizard inserts), Waitlist_Auto_Promote (after-save, promotes oldest Waitlisted when a seat cancels)
waitlistTracker LWC + WaitlistTrackerController for the Instance record page (bucketed view, position numbers, row actions)
Additive edits to SummitEventsShared.isEventClosed, SummitEventsConfirmationController.checkEventDetails, and the two SELECTs (SummitEventsReadShared.getInstanceById, SummitEventsFeed.getEventList)
Count_of_Attendees__c filter: added Pre-Registered to match sibling Primary_Attendees__c
Issues Closed
N/A