Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This feature is not General Available yet, please reach out to us if you need more information.

Parent and child reservations are a useful feature if you want to split your reservations into smaller reservations. This can help you optimize your planning by allowing you to specify what you need for parts of the reservations.

Notetip

Sample use case where a client books an appointment for a treatment for an hour.

  • Parent reservation at clinic Amsterdam between 10:00 - 11:00

    • Child reservation 1 (intake) - 10:00-10:15

      • Intake room 1 + Support Staff

    • Child reservation 2 (medical treatment) - 10:15 - 10:45

      • Treatment Room 2 + Doctor Staff

    • Child reservation 3 (Recovery) - 10:45 - 11:00

      • Resting room 1 no staff needed

...

Setting it up Parent Child Reservations starts with creating a reservation blueprint, this basically determines what the actual parent and child reservation combination consists of and creates the possible combinations.

Noteinfo

Try to make these templates as specific as possible as they determine how many combinations will need to be conflict checked. This is a very performance demanding task for Salesforce, so try to keep the options as limited as possible.

Extending the number of staff/resources and or sub-reservations multiplies very quickly.

...

  • First go to reservation types

  • Go to Reservation Blueprints

  • Create new blueprint called Treatment appointment to create the parent

    • Give it a duration of 60 minutes

      image-20240429-122153.png

    • Go to related, fields to set

      • Add reservation type: Treatment

        image-20240429-122246.png

  • Create a new child blueprint called Intake

    image-20240429-122332.png

  • Give it a duration of 15 minutes

  • Give it a order, this determines the sequence in which the reservations take place

    • Go to related, fields to set

      • Add reservation type: Intake

      • Add fields to be set: Reservation Type

      • Add fields to set: Resource in parent resource

        image-20240429-122635.png

  • Create a new child blueprint called Medical treatment

  • Give it a duration of 30 minutes

    • Add reservation type: Treatment

    • Add fields to be filled: Staff available in Parent Resource

    • Add fields to be filled: Resource in parent resource

      image-20240429-141638.png

  • Create a new child blueprint

  • Give it a duration of 15 minutes

  • Go to related, fields to set

    • Add reservation type: Recovery

    • Add fields to be filled: Resource in parent resource

Below you’ll find some sample code to retrieve the time slots for a parent location

Code Block

breakoutModefull-width
// Generate possibilities CompositeReservationTemplates.Context templateContext = new CompositeReservationTemplates.Context(); templateContext.templateName = 'Treatment Appointment'; templateContext.prototype = new Reservation__c( B25__Resource__c = 'RESOURCEID' ); templateContext.rangeStartDate = Date.newInstance(2024, 01, 01); templateContext.rangeEndDate = Date.newInstance(2024, 01, 02); CompositeReservationTemplates.Result templateResult = CompositeReservationTemplates.createReservationsFromTemplate(templateContext); // Get timeslots TimeSlotGenerator.Context timeSlotContext = new TimeSlotGenerator.Context(); timeSlotContext.startOfRange = Datetime.newInstance(2024, 01, 01, 0, 0, 0); timeSlotContext.endOfRange = Datetime.newInstance(2024, 01, 02, 0, 0, 0); timeSlotContext.duration = 60; ReservationCollectionTimeSlotFinder.Context findContext = new ReservationCollectionTimeSlotFinder.Context(); findContext.collectionsToCheck = templateResult.collections; findContext.timeSlotContext = timeSlotContext; ReservationCollectionTimeSlotFinder.Result result = ReservationCollectionTimeSlotFinder.findTimeSlots(findContext);Usefull links:

ReservationBlueprints

ReservationCollection

ReservationCollectionTimeSlotFinder