Opening Day Readiness Trials

Trial Availability — End-to-End Test Walkthrough

This guide takes you through the full feature you just built: express interest → receive the invitation email → confirm availability for your party → convert those confirmations into Trial Registrants. Follow the steps in order.

Environment: LucasBox sandbox
Interest form Verify contact Run Apex (send email) Click email Confirm availability Open Ready trial Create Registrant Verify
0
Prerequisite: put 3 trials into "Ready"

The availability form only shows trials whose Stage = Ready. Set three trials to Ready so you have enough to test the multi-select and the matrix.

Open Trial List View
  • Open three different trials and set Stage to Ready (or use inline edit directly in the list view, then Save).
  • Give each a Start Date/Time and a Location if they're blank — the form shows date/time and location, so this makes the test look realistic.
Keep this tab handy — you'll come back to the list view in Step 6.
1
Express interest (create your Contact + party)

Fill out the public Expression of Interest form as if you were a volunteer.

Open Interest Expression Form
Important — add party members. When the form asks about your group / family, add at least 1–2 additional people. These become EOI Group Member records and are what let us test the party matrix and the auto-created party registrations later. Use a real email address you can open for the main person so you can receive the invitation in Step 4.

Submit the form. Behind the scenes this creates your Contact (under the "Event Volunteer" account) plus one EOI Group Member per party member.

2
Verify your Contact was created & open it

Confirm the submission landed. Use either route, then click into your Contact record.

Open Report Open "Event Volunteer" Stakeholder
  • From the Event Volunteer account, open the Contacts related list and find the name you just entered.
  • Or find yourself in the Report and click your name.
  • On your Contact, peek at the EOI Group Members related list — your party members should be listed there.
3
Send yourself the invitation email (Anonymous Apex)

3a. Grab your Contact Id from the URL. With your Contact open, look at the browser address bar. The Id is the 003… value between /Contact/ and /view:

.../lightning/r/Contact/003XXXXXXXXXXXXXXX/view

Copy that 003… value.


3b. Open the Developer Console.

  • Click the ⚙ Setup gear (top-right) → Developer Console. A new window opens.
  • In that window, menu DebugOpen Execute Anonymous Window (or press Ctrl + E).

3c. Paste this script, replace PASTE_YOUR_CONTACT_ID_HERE with the Id from 3a, then click Execute. The template Id is already filled in for you.

// === Lucas Museum — send the Trial Availability invitation to YOUR test contact ===

// 1) Paste your Contact Id between the quotes (from the record URL, Step 3a).
Id contactId = 'PASTE_YOUR_CONTACT_ID_HERE';

// 2) Trial Availability Invitation template — already built & deployed.
Id templateId = '00XV9000002CDwPMAW';

Messaging.SingleEmailMessage msg = new Messaging.SingleEmailMessage();
msg.setTemplateId(templateId);
msg.setTargetObjectId(contactId);   // fills {!Contact.*} merge fields + the ?cid= link
msg.setSaveAsActivity(false);
Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{ msg });

System.debug('>>> Invitation sent to Contact ' + contactId);
Success looks like: the bottom log shows Execution finished successfully (no red errors). If you see an email-deliverability error, make sure your contact has a valid Email and that Setup → Deliverability is set to All email in the sandbox.
This is the exact template the production sender uses. In production, staff run the one-liner TrialAvailabilityInviteService.invite(new List<Id>{ '003…' }); (or inviteAllEventVolunteers()), which looks the template up by name and sends in bulk.
4
Check your inbox & click the button

Open the email "Action needed: confirm your availability for the upcoming Lucas Museum trials" and click CONFIRM MY AVAILABILITY. It deep-links to your personalized availability page (the page already knows who you are via the ?cid= in the link).

Email not arriving? You can jump straight to your page instead — take the base link below and append ?cid= + your Contact Id:
https://lucas-citiri--lucasbox.sandbox.my.site.com/s/trial-availability?cid=003XXXXXXXXXXXXXXX
Open Availability Page (then add ?cid=)
5
Confirm availability for you & your party

On the page you'll see your name pre-filled at the top. Then:

  • Under "Which trials can you attend?", check two or more of the Ready trials.
  • The Your Party matrix appears below (because you added party members in Step 1). Tick which of your party can make each trial you selected — leave at least one party member checked so we can see a party registration get created later.
  • Click Confirm Availability. You'll see the "Availability Submitted" screen.
Re-opening the link now goes straight to the "Availability Submitted" screen with a Change my availability option — that's the idempotent edit behavior working.
6
Open one of your Ready trials

Switch to the admin side. Go back to the Trial list view and click into one of the Ready trials you selected availability for.

Open Trial List View
  • On the trial record, open the Participation tab.
  • Scroll to the Trial Availability related list (it sits right beneath Trial Registrations). Your confirmation row should be there, with your Name, Email, Phone Number, and a Party Members count.
7
Create the registrant(s)
  • In the Trial Availability related list, select your row (the checkbox on the left). You can select more than one if you have several.
  • Click Create Registrant (top-right of the list).
  • Wait for the green success toast — e.g. "1 registrant(s) created, 1 party member(s)."
Behind the scenes this creates a Trial Registration for you (Status = Confirmed), promotes each selected party member into a real Contact, and creates a child Trial Registration for each — all linked to your parent registration.
8
Verify the results

Confirm everything happened, all on the same trial record:

  1. The availability row disappeared. The Trial Availability related list no longer shows your row (it's flagged Registration Created and filtered out).
  2. Registrations were created. Open the Trial Registrations related list on the same trial. You should see:
    • One registration for you (the primary), Status Confirmed.
    • One registration for each party member you checked — Status Confirmed, with Parent Registration pointing at your registration.
  3. Party members became Contacts. Open a party-member registration and click its Contact — it's a newly created Contact under the Event Volunteer account (with a placeholder gm-…@example.com email).
If all three check out, the full loop works: interest → invite → confirm → registrants (primary + promoted party members). 🎉