Follow this guide to move your org from the legacy Service structure to Services as a Dimension. You only need it if your org was set up on GoMeddo 7.4 or earlier and still uses the legacy Service objects. From GoMeddo 7.5, new installs use the new model by default and already contain the Dimension and rules described here.
In the legacy structure, a Service and Service Type describe what can be booked, a Service Availability record makes a Service available on a Resource in a given quantity, and the Service Reservation junction object links Services to Reservations. In the new structure, Service becomes a regular Dimension, the same framework GoMeddo uses for Resources, Staff, and other bookable records. The existing Service Reservation junction is registered as a Dimension Junction, and Multi-Dimensional Availabilities (MDAs), availabilities that only apply when two Dimension records are combined, replace Service Availability. Services then work with the same tools as every other Dimension: Conflict Rules, Filter Rules, Ranking Rules, and Dimension Junction Display Settings.
Before you start, make sure the following is in place:
-
A sandbox running GoMeddo 7.5 or later, so you can run the whole migration there before production. See Install the latest GoMeddo version.
-
Contextual Price Calculations are configured.
-
Conflict Rules are enabled in GoMeddo Settings. Enabling them switches off any conflict checking configured on the Dimensions themselves, so only rules apply from then on.
-
A list of the Resources that have a Service Availability today, with their time windows and capacities.
-
A list of the pricing and quantity fields you use on service lines today, such as Unit Price, Price, Quantity, Subtotal, and Service Costs.
Overview
The migration has six stages. Do them in this order, since each stage builds on the one before it:
-
Create the Service Dimension.
-
Register the Service junction.
-
Show Services on the reservation form.
-
Recreate Service Availabilities as MDAs.
-
Add a Service capacity Conflict Rule.
-
Turn off legacy services.
Once the first three stages are in place, the reservation form shows Services twice until you turn off legacy services. In production, run all six stages in one session at a quiet moment.
Don't delete your existing Service, Service Type, or Service Availability records until you've confirmed the new setup works. You need them as a reference while you rebuild availability, and as a fallback if you roll back.
Create the Service Dimension
Create the Dimension record for Service directly instead of using the Dimension Wizard. The wizard sets up a new dimension, and optionally a new junction object, from scratch. Your org already has a junction between Reservation and Service from the legacy structure, and you reuse it in the next stage.
-
In the App Launcher, open the Dimension tab.
-
Click New.
-
Fill in the fields as shown in the table below.
-
Click Save.
|
Field |
Value |
|---|---|
|
Name |
|
|
Dimension Name Field |
|
|
Availability Lookup |
|
|
MDA Applies To This Dimension Only |
Selected. MDAs that reference a Service then grant availability to the Service only, so they don't also make the Resource available. |
The Service Dimension is saved, ready for the junction you register next.
Register the Service junction
Reservations and Services are already linked by the legacy junction object B25__Service_Reservation__c, which stores fields such as Quantity, Unit Price, Price, Subtotal, and Service Costs on each service line. Register this junction as a Dimension Junction and tell GoMeddo which junction field holds which value.
-
In the App Launcher, open the Dimension Junction tab.
-
Click New.
-
Fill in the fields as shown in the table below.
-
Click Save.
|
Field |
Value |
|---|---|
|
Dimension |
The Service Dimension you created in the previous stage. |
|
Name |
|
|
Reservation Lookup API Name |
|
|
Dimension Lookup API Name |
|
|
Price Field |
|
|
Default Price Field |
|
|
Quantity Field |
|
|
Subtotal Field |
|
|
Total Field |
|
If your org renamed or customized any of these fields, use your own API names instead.
GoMeddo now treats the Service Reservation junction as the link between Reservations and the Service Dimension.
Show Services on the reservation form
To show the Service junction as a related list on the reservation form, create a Dimension Junction Display Setting on each Reservation Type that books Services.
-
Open a Reservation Type that books Services, and go to the Related tab.
-
In the Dimension Junction Display Settings related list, click New.
-
Set Dimension Junction to the Service junction you registered in the previous stage.
-
Set Field Set to use to
B25__CustomFields. -
Set Collapsed Field Set To Use to
B25__CollapsedFields. -
Click Save.
-
Repeat for every other Reservation Type that books Services.
These two field sets on the Service Reservation junction already control the extra fields in the expandable section and in the collapsed row under the legacy structure. Reusing them keeps the reservation form looking the same for your users. For the other fields on this setting, such as Order and Label, see Displaying Dimension Junctions on the Reservation Form.
The reservation form now shows a Services related list. Until you turn off legacy services, it also still shows the legacy services section.
Recreate Service Availabilities as MDAs
A legacy Service Availability record made a Service available on a Resource, with an optional capacity, and that availability applied to the Resource's children too. You get the same result with an MDA between the Service and the Resource.
For each Resource that has a Service Availability today:
-
Open the Service and create a new Availability record for it.
-
Select Is Dependent Availability.
-
Set the Resource lookup to the Resource that had the Service Availability.
-
Copy the time window from the legacy Service Availability record.
-
If the legacy record had a capacity, copy it to the capacity field on the Availability.
-
Click Save.
Inheritance works as before: an MDA on a parent Resource also applies to its children. If you can't see the capacity field on the Availability, add it to your Availability page layout.
The Resource and Service lookups on the reservation form now filter each other based on these MDAs. For how MDAs behave in detail, including how they show on the calendar, see Multi-Dimensional Availabilities.
Add a Service capacity Conflict Rule
Under the legacy structure, Service Availability and its capacity limited what users could book. With Service as a Dimension, a Conflict Rule linked to the Service Dimension takes over that check. The rule below blocks a reservation when the Service has no matching availability, or when the requested quantity plus everything already booked for that Service under the same availability exceeds the availability's capacity.
-
In the App Launcher, open the Conflict Rule tab.
-
Click New Rule.
-
Enter a name for the rule.
-
Link the rule to the Service Dimension.
-
Mark the rule as active.
-
Paste the formula below into the formula editor.
-
Set the conflict type to hard, so the rule blocks the reservation instead of showing a warning.
-
In Validation Message, enter a message such as
This service is not available in the requested quantity. -
Save the rule.
// First we make sure that we are checking the service reservation junction
dimensionElement == "b25__servicereservations__r" AND
(
//Check if the service has any availability
isNotAvailable()
OR
(
// Get the total service quantity of the current reservation for the service we are booking
SUM(
FILTER(b25__ServiceReservations__r as junction, junction.B25__Service__c == b25__ServiceReservations__r[junctionIndex].B25__Service__c),
B25__Quantity__c, 1
) +
// get all of the overlapping reservations that are under the same availability, filter down the service reservations related list to only the entries that are the same service as the one currently being checked.
// Then sum all their quantities and compare the total quantity with the capacity of the currently active availability.
SUM(
FOREACH(
FILTER(overlappingReservations as res, res.B25__Resource__r.B25__Full_Path__c STARTSWITH matchingAvailabilities[0].B25__Resource2__r.B25__Full_Path__c)
as res,
SUM(
FILTER(res.b25__ServiceReservations__r as junction, junction.B25__Service__c == b25__ServiceReservations__r[junctionIndex].B25__Service__c),
B25__Quantity__c, 1
)
)
)
) > matchingAvailabilities[0].B25__Capacity__c
)
How the formula works:
-
The
dimensionElement == "b25__servicereservations__r"check limits the rule to the Service junction. A Conflict Rule linked to a Dimension runs once for every way a reservation is linked to that Dimension. -
isNotAvailable()blocks the reservation when the Service has no matching availability at all. -
The first
SUMadds up the quantity of every service line on the current reservation for the same Service. -
The second
SUMadds up the quantities for the same Service on all overlapping reservations under the Resource of the matching availability, including its child Resources throughB25__Full_Path__c STARTSWITH. -
If the combined total is higher than the capacity on the matching availability, the rule blocks the reservation.
If your org customized any of the field API names in the formula, adjust them to match. For the full list of operators and functions, see Conflict Rules and Filter Rules.
Users who book more of a Service than its availability allows, or a Service that isn't available on the selected Resource, now see your validation message and can't save the reservation.
Turn off legacy services
With the Dimension, junction, display settings, MDAs, and rule in place, switch GoMeddo over to the new structure.
-
Open the GoMeddo Settings page.
-
Go to the Validation section.
-
Clear Enable legacy services.
-
Save your changes.
Turning off this setting changes how Services are booked and priced for all users at once. Make the change in production at a quiet moment, so you can check a few real reservations with Services straight afterwards.
GoMeddo stops using the legacy Service objects and treats Service like any other Dimension. The legacy services section disappears from the reservation form, so Services show once.
Check the migration
Create a test reservation on a Resource that has a Service MDA, and check that:
-
The Services related list appears once, with the same extra fields as before.
-
Only Services that are available on the selected Resource are offered.
-
Price, subtotal, and total on each service line are calculated as before.
-
Booking more than the capacity shows your validation message and blocks the save.
Roll back
The switch is reversible. Select Enable legacy services again, and GoMeddo goes back to using the legacy Service objects. While the Service Dimension, junction, and display settings exist, the reservation form then shows Services twice.
What changes after the migration
Reservation form
-
The built-in services section is gone. Services show as an ordinary junction related list, so the order, label, and field set options on the Dimension Junction Display Setting apply.
-
The Hide Service Section setting on Reservation Type no longer has any effect. Control the Services list with the Dimension Junction Display Setting instead.
Service search
-
Legacy service search left out inactive Services. The junction search doesn't. To keep inactive Services out of the results, filter the list with Custom Form Logic, or make sure those Services have no availability.
-
Legacy service search showed the maximum remaining quantity next to each result. The junction search doesn't. You can rebuild this with Custom Form Logic, but depending on how complex your availabilities are, it can take considerable effort.