Overview
GoMeddo provides overlappingReservations and matchingAvailabilities as variables to use in your rules. However, if you want to get possibly conflicting reservations based on something that is not a dimension field, you can use custom variables. This allows you to get all the reservations that overlap in time and have a specific field in common with the reservation being conflict checked.
Creating a custom variable
To create a custom variable, go to the record page of any conflict rule. On this page, there is a tab called custom variables
On this tab is a list of all the custom variables present in the org. Click new to create a new custom variable. There are two fields to populate when creating a new custom variable.
-
Name: The name of the variable; this is then used to reference it in a rule.
-
Field Paths: Field paths starting from reservation that need to match the reservation being checked to be included in this variable.
If, for example, you want all of the reservations that overlap with the same parent resource as the reservation being checked, Field Paths would be B25__Resource__r.B25__Parent__c
If you have a large number of reservations, it is recommended that all the field paths specified here are indexed in some way, either by being lookups, external IDs, or custom indexes. Otherwise, there is a risk of running into a Non-Selective Query Error.
Using the custom variable in a rule
To use the custom variable, you can reference it in a rule the same way you would overlappingReservations. So a rule that uses a custom variable overlappingTitles that looks for other reservations with the same B25__Title__c field, the rule COUNT(overlappingTitles) > 0 would prevent a reservation with the same title being created at the same time.
Custom Time Range
Normally custom variables behave like overlappingReservations meaning that during rule execution only the matching reservations at the same time will be included. However in some cases it might be useful to get all matching reservations even if they don’t overlap. To do this check the Ignore Times checkbox. As an example if you want all child reservations of a parent reservation you would create a custom variable with the path B25__Parent_Reservation__c and the Ignore Times checkbox checked.