This feature is in beta and not general available yet, please reach out to support@gomeddo.com if you have any questions.
Getting started
As it’s in beta, you first need to install our latest version 5.6 or later Install the latest version
Navigate to GoMeddo settings, and enable the setting to enable this new way of conflict checking
After doing so, all conflict checking configured on the dimension itself, are disabled and only the rules will be used from now on.
Creating rules
Navigate to the Booking Restriction Rule tab, press new rule.
Provide a name for this rule
Optionally, link it to a dimension
Mark it as being active or not, if inactive the rule will not work or be validated upon save.
Formula itself - type here the formula itself, if the formula is true, it will conflict
Conflict type, is it a blocking (hard) conflict or a warning (soft) conflict
Validation message, this will be shown to the user as reason why it’s not allowed.
Save, if the rule is marked as active, it will be checked on syntax and fields referenced.
Important is that when the result is true, the reservation will be blocked. This is why we call the rules “reservation restrictions”.
The basic idea:
We offer an “Reservation restriction” object where you can configure rules to block a reservation when being created or changed.
You can create easy rules and more complex rules, using below described operators and functions.
You can use fields on the reservation and fields of the related dimension record if you link your rule to a dimension.
Basically you can create your own rule defining when a reservation is not allowed.
A simple rule would look like this:
b25__Title__c == 'invalid'
Which would result in all reservation with the title “invalid” to conflict.
Hard or soft
The rule has a type, the type can be hard of soft, resulting in either a warning or blocking the reservation. You don’t need to add this in the formula but can mark the “rule” record in Salesforce as Hard or Soft.
Operators
We will support the following logical operators:
Operation | Description |
---|---|
== | Checks if two values are equal. Returns true if they are, false otherwise. |
!= | Checks if two values are not equal. Returns true if they are not, false otherwise. |
> | Checks if the left value is greater than the right value. Returns true if it is, false otherwise. |
>= | Checks if the left value is greater than or equal to the right value. Returns true if it is, false otherwise. |
< | Checks if the left value is less than the right value. Returns true if it is, false otherwise. |
<= | Checks if the left value is less than or equal to the right value. Returns true if it is, false otherwise. |
CONTAINS | Checks if a text value contains a specified substring. Returns true if it does, false otherwise. |
LIKE | Performs a pattern matching comparison between a text value and a specified pattern. Returns true if the pattern matches, false otherwise. |
NOT | Negates the Boolean value of an expression. Returns true if the expression is false, false if it is true. |
ISBLANK | Checks if a field or expression is blank (empty) or null. Returns true if it is blank, false otherwise. |
Functions
Some functions that return a number:
SUM(listofnumbers) → yields the sum of all the number in a list
SUM(listofrecords, numberfield) → yields the sum of all the number fields
COUNT(list) → yields the number of items in the list
MIN(listofrecords, numberfield) → yields the lowest number in all of the numberfields
MIN(listofnumbers) → yields the lowest number in a list
MAX(listofrecords, numberfield) → yields the highest number in all of the numberfields
MAX(listofnumbers) → yields the highest number in a list
Support some ways to filter a list:
FILTER(records AS record, record.number_field__c > 5) → yields a potentially smaller list of any items for which the condition is true
Support some way to iterate over a list:
FOREACH(records AS record, record.number_field__c) → yields a new list of the result of the formula of each record.
You can combine the functions to create rules:
COUNT(FILTER(records AS record, record.number_field__c > 5)) == 0 → returns TRUE if at least one record has a value higher than 5
Rule linked to dimension
If you link your rule to a dimension, two special variables will become available to use in the formula:
overlapping_reservations
overlapping reservations with the reservation being checkedCOUNT(overlappingReservations) > 0
No overlapping reservation are allowedmatchingAvailablilities
Allowing you to use the availablility or unavailablility of the related dimension in your formula.COUNT(matchingAvailabilities) == 0
Reservation not allowed when there is no availability or if there are unavailabilities.
Examples rules:
Important is that when the result is true, the reservation will be blocked. This is why we call the rules “reservation restrictions”.
Basic rules
Reservation not allowed when title matches invalid.
b25__Title__c == 'invalid'
Reservation not allowed when Resource name = invalidb25__Resource__r.Name == 'invalid'
Reservation not allowed when Reservation title matches reservation notes.
b25__Title__c == B25__Notes__c
Reservation not allowed when overlapping with other reservation.
COUNT(overlapping_reservations) > 0
Reservation not allowed if no availability
COUNT(matchingAvailabilities) == 0
More advanced rules
Reservation not allowed when overlapping with other reservations, not taking into account reservation with status “cancellled”
COUNT(FILTER(overlapping_reservations AS item, item.b25__status__r.name != ‘Canceled’ AND item.b25__status__r.name!="Temporary")) > 0
Reservation not allowed when Resource does not allow double booking and when overlapping with another reservation.
Resource__r.Allow_Double_Booking__c == false AND COUNT(overlapping_reservations) > 0
Reservation not allowed when when overlapping with more reservations then specified at the “max capacity field specified on the related resource.
COUNT(overlapping_reservations) > Resource__r.Max_Reservations__c
Reservation not allowed when the resource has no availability and the checkbox overbooking is allowed is disabled.
b25__Resource__r.overbookable == false AND COUNT(matchingAvailabilities) == 0
Reservations are not allowed when there are no availability where the availabilty type matches the reservation type.
COUNT(FILTER(matchingAvailabilities as item, item.Availability_type__c == B25__Reservation_Type__r.Name)) == 0
Reservations are not allowed when going over the lowest availability’s capacity
B25__Quantity__c > MIN(matchingAvailabilities, capacity__c)
Reservations are not allowed when going over the sum of all availabilities' capacity
B25__Quantity__c + SUM(overlappingReservations, B25__Quantity__c) > SUM(matchingAvailabilities, capacity__c)
Reservations are not allowed when no capacity or different gender.
B25__Quantity__c + SUM(overlappingReservations, B25__Quantity__c) > SUM(matchingAvailabilities, capacity__c) OR COUNT(overlappingReservations AS rsv, rsv.Gender__c != Gender__c) > 0
Not supported in this beta:
Realtime validation retriggers on all fields used in the formula (excepted soon)
Intelligent lookups & find available dimension id (excepted soon)
Multi Dimensional availability (excepted soon)
Overlapping reservation containing reservations from other resources.
Resource grouping
Services
“Unshared conflict checking” Shared vs Unshared Conflict Checking
Timeslot picker Time Slot Picker