Example Conflict Rules

Basic Availability checking

For basic availability checking, you can use the built-in formula IsNotAvailable(). This will return true if the reservation is linked to any record (of the rule’s Dimension) that is not available at that time. For example, consider the following rule:

Dimension

Staff

Conflict Type

Hard

Formula

IsNotAvailable()

This rule will result in an error if the reservation is linked to a Staff record which is not available.

Soft/Hard conflicts based on user permissions

This example shows how to grant permissions to certain users, allowing them to make reservations outside of opening times with warnings (soft conflicts) instead of errors (hard conflicts).

If you are using the time slot picker keep in mind that it shows slots with soft conflicts, but not with hard conflicts. You can use these rules to show more options to employees than to customers for example.

For this example, we will use the ‘Allow Double Booking’ custom permission included in GoMeddo, but you can also create your own: Help And Training Community

  1. Create a conflict rule with the Conflict Type set to HARD. Give it the following formula:

IsNotAvailable() AND $Permission.ALLOW_DOUBLE_BOOKING != true
  1. Create a conflict rule with the Conflict Type set to SOFT. Give it the following formula:

IsNotAvailable() AND $Permission.ALLOW_DOUBLE_BOOKING == true

 

Conflict Rule library

Basic rules

Rule

Description

Condition

Rule

Description

Condition

Invalid Title

Reservation not allowed when title matches "invalid".

B25__Title__c == 'invalid'

Invalid Resource Name

Reservation not allowed when the resource name is "invalid".

B25__Resource__r.Name == 'invalid'

Matching Title and Notes

Reservation not allowed when the reservation title matches the reservation notes.

B25__Title__c == B25__Notes__c

No Overlapping Allowed

Reservation not allowed when overlapping with another reservation.

COUNT(overlappingReservations) > 0

No Availability

Reservation not allowed if no availability exists.

COUNT(matchingAvailabilities) == 0

or

isNotAvailable()

More advanced rules

 

Rule

Description

Condition

Rule

Description

Condition

No Overlapping Reservations

Reservation not allowed when overlapping with other reservations, excluding reservations with status "Canceled" or "Temporary".

COUNT(FILTER(overlappingReservations AS item, item.b25__status__r.name != 'Canceled' AND item.b25__status__r.name != 'Temporary')) > 0

No Double Booking

Reservation not allowed when the resource does not allow double booking and overlaps with another reservation.

Resource__r.Allow_Double_Booking__c == false AND COUNT(overlappingReservations) > 0

Respect Max Capacity

Reservation not allowed when overlapping with more reservations than specified in the "Max Capacity" field on the related resource.

COUNT(overlappingReservations) > Resource__r.Max_Reservations__c

No Availability, Overbooking Disabled

Reservation not allowed if the resource has no availability and the "Overbookable" checkbox is disabled.

B25__Resource__r.Overbookable__c == false AND COUNT(matchingAvailabilities) == 0

Matching Availability Type

Reservation not allowed when there is no availability with an availability type that matches the reservation type.

COUNT(FILTER(matchingAvailabilities AS item, item.Availability_type__c == B25__Reservation_Type__r.Name)) == 0

Exceeding Lowest Availability Capacity

Reservations not allowed when exceeding the lowest availability’s capacity.

B25__Quantity__c > MIN(matchingAvailabilities, Capacity__c)

Check Room Capacity

Reservations are checked against the room’s capacity, or bypassed if the status allows double booking.

B25__Quantity__c + SUM(overlappingReservations, B25__Quantity__c) > B25__Resource__r.B25__Capacity__c AND B25__Status__r.B25__AllowDoubleBooking__c == false

Exceeding Total Availability Capacity

Reservation not allowed when exceeding the sum of all availabilities' capacity.

B25__Quantity__c + SUM(overlappingReservations, B25__Quantity__c) > SUM(matchingAvailabilities, Capacity__c)

Capacity and Gender Constraints

Reservations not allowed when no capacity is available, or there is a different gender conflict.

B25__Quantity__c + SUM(overlappingReservations, B25__Quantity__c) > SUM(matchingAvailabilities, Capacity__c) OR COUNT(FILTER(overlappingReservations AS rsv, rsv.Gender__c != Gender__c)) > 0

Double Booking Permission

Reservation not allowed to be double-booked if the user does not have permission to "Overrule Double Bookings".

COUNT(overlappingReservations) > 0 AND $Permission.B25__ALLOW_DOUBLE_BOOKING == false

Resource Availability Check (Widget)

Raises a conflict if there is no availability or if there is unavailability.

COUNT(FILTER(matchingAvailabilities AS ava, ava.B25__Unavailability__c == true)) != 0 OR COUNT(FILTER(matchingAvailabilities AS ava, ava.B25__Unavailability__c != true)) == 0

External Client Quantity Check

Raises a conflict if the B25LP__Quantity_For_External_Client__c of all reservations at the same time exceeds the resource capacity.

SUM(overlappingReservations, B25LP__Quantity_For_External_Client__c) + B25LP__Quantity_For_External_Client__c > B25__Resource__r.B25__Capacity__c