...
The formula itself is where you define the condition for the rule. If the formula evaluates to true, it will result in a conflict. You can use various logical operators such as == (equal), != (not equal), > (greater than), >= (greater than or equal to), < (less than), <= (less than or equal to), CONTAINS, LIKE, NOT, and ISBLANK, STARTSWITH.
Additionally, there are functions available for performing calculations and filtering lists. When linked to a dimension, you can access special variables like overlappingReservations and matchingAvailabilities to further rules for availability checking or double bookings.
...
As it’s in a first version, you first need to install our latest version 5.9 or later Install Upgrade to 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.
If you want to limit the number of reservations to which your rules are applied, take a look at Rulesets, Rulesets allow you to group Conflict Rules and filter to which reservations these Conflict Rules are applied.
Creating and editing rules
...
Please provide a name for this rule. Optionally, link it to a dimension. Mark it as active or inactive. If inactive, the rule will not work or be validated upon save.
Type the formula itself here, using the function and operators in the formula editor.
If the formula is true, it will cause a conflict. You can use the syntax checker to validate your rule.Specify the conflict type: Is it a blocking (hard) conflict or a warning (soft) conflict?
Enter the validation message. This will be shown to the user as the reason why it’s not allowed.
Save the rule. If the rule is marked as active, it will be checked for syntax and referenced fields again.
Note |
---|
Important is that when the result is true, the reservation will be blocked. This is why we call the rules “Conflict Rules”. |
...
We will support the following logical operators:
Operation | Description | Example |
---|---|---|
== | 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. |
|
STARTSWITH | Checks if a text value starts with the specified substring. Returns true if it does, false otherwise. |
|
LIKE | Performs a pattern matching comparison (RegEx) between a text value and a specified pattern. Returns true if the pattern matches, false otherwise. |
Also see: https://help.salesforce.com/s/articleView?id=sf.customize_functions_regex.htm&type=5 |
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 |
|
[index] | Array index operator. Returns the element at the specified index in a list (starting with zero). For example |
|
Functions
Rules serve different functions, with some of them returning numerical values that you can use in your formula.
SUM(listofnumbers)
-> yields the sum of all the number in a listSUM(listofrecords, numberfield)
-> yields the sum of all the number fieldsCOUNT(list)
-> yields the number of items in the listMIN(listofrecords, numberfield)
-> yields the lowest number in all of the numberfieldsMIN(listofnumbers)
-> yields the lowest number in a listMAX(listofrecords, numberfield)
-> yields the highest number in all of the numberfieldsMAX(listofnumbers)
-> yields the highest number in a listIsNotAvailable()
→ returns true if in basic availability checking the dimension is not available. Taking into account inheritance and unavailabilities. It is the equivalent of(COUNT(matchingAvailabilities) == 0 OR matchingAvailabilities[0].B25__Unavailability__c == true)
IF(condition, then, else)
→ when the value of thecondition
is true, return the value ofthen
, otherwise return the value ofelse
.
You can filter records by using the filter function:
...
overlappingReservations
overlapping reservations with the reservation being checkedCOUNT(overlappingReservations) > 0
This rule would make sure that no overlapping reservation are allowedmatchingAvailablilities
Allowing you to use the availability or unavailability of the related dimension in your formula.
This list ofB25__Availability__c
records is ordered from most important to least important.COUNT(matchingAvailabilities) == 0
Reservation not allowed when there is no availability or if there are unavailabilities.
...
You can also reference and check the permissions of the running user in your rule.
By adding: $Permission.Custom_Permission_NameCOUNT(overlappingReservations) > 0 and $Permission.B25__ALLOW_DOUBLE_BOOKING == false
...
Example rules
...
Note |
---|
Important is that when the result is true, the reservation will be blocked. This is why we call the rules “Conflict Rules”. |
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(overlappingReservations) > 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 “Canceled” AND status “Temporary”
COUNT(FILTER(overlappingReservations 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(overlappingReservations) > 0
Reservation not allowed when when overlapping with more reservations then specified at the “max capacity field specified on the related resource.
COUNT(overlappingReservations) > Resource__r.Max_Reservations__c
Reservation not allowed when the resource has no availability and the checkbox overbookable is disabled.
B25__Resource__r.Overbookable__c == false AND COUNT(matchingAvailabilities) == 0
Reservations are not allowed when there are no availability where the availability 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
Reservations are not allowed to be double booked and when the running user doesn’t have the permission to “overrule double bookings”
COUNT(overlappingReservations) > 0 and $Permission.B25__ALLOW_DOUBLE_BOOKING == false
Not supported yet:
...
Overlapping reservation containing reservations from other resources.
...
Resource grouping
...
Services
Take a look at our example Conflict Rules
Features not supported by Conflict Rules
“Unshared conflict checking” Shared vs Unshared Conflict Checking
Timeslot picker Time Slot Picker (for record pages)