Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This feature is in beta and not general available yet, please reach out to support@gomeddo.com if you want to start using this. new and will replace the existing conflict checking configuration on dimension in the future.

Table of Contents
minLevel1
maxLevel3
outlinefalse
typelist
printablefalse

Overview

Reservation restriction rules Conflict Rules allow you to implement your business rules for reservations, by allowing you restrict your reservations based on rules.
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.

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 overlapping_reservations overlappingReservations and matchingAvailabilities to further rules for availability checking or double bookings.

...

By combining operators, functions, and variables, you can create simple or advanced rules to handle conflicts based on specific criteria, such as resource availability, overlapping reservations, and more.

Getting started

As it’s in betaa first version, you first need to install our latest version 5.6 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

Navigate Go to the Booking Restriction "Conflict Rule tab, press new rule.

...

" tab and click on "New Rule” or select an existing rule from the list.

  1. Please provide a name for this rule

...

  1. . Optionally, link it to a dimension

...

  1. . Mark it as

...

  1. active or

...

  1. inactive. If inactive, the rule will not work or be validated upon save.

...

  1. Type the formula itself

...

  1. here, using the

...

  1. function and operators in the formula editor.
    If the formula is true, it will cause a conflict

...

  1. . You can use the syntax checker to validate your rule.

  2. Specify the conflict type: Is it a blocking (hard) conflict or a warning (soft) conflict?

...

  1. Enter the validation message. This will be shown to the user as the reason why it’s not allowed.

  2. Save

...

  1. the rule. If the rule is marked as active, it will be checked

...

  1. for syntax and referenced fields

...

  1. again.

Note

Important is that when the result is true, the reservation will be blocked. This is why we call the rules “reservation restrictions”“Conflict Rules”.

...

Operators

We will support the following logical operators:

Operation

Description

Example

==

Checks if two values are equal. Returns true if they are, false otherwise.

B25__Title__c == "a string"

!=

Checks if two values are not equal. Returns true if they are not, false otherwise.

B25__Title__c != "a string"

>

Checks if the left value is greater than the right value. Returns true if it is, false otherwise.

B25__Capacity__c > 10

>=

Checks if the left value is greater than or equal to the right value. Returns true if it is, false otherwise.

B25__Capacity__c >= 10

<

Checks if the left value is less than the right value. Returns true if it is, false otherwise.

B25__Capacity__c < 10

<=

Checks if the left value is less than or equal to the right value. Returns true if it is, false otherwise.

B25__Capacity__c <= 10

CONTAINS

Checks if a text value contains a specified substring. Returns true if it does, false otherwise.

B25__Title__c CONTAINS "a string"

STARTSWITH

Checks if a text value starts with the specified substring. Returns true if it does, false otherwise.

B25__Title__c STARTSWITH "a string"

LIKE

Performs a pattern matching comparison (RegEx) between a text value and a specified pattern. Returns true if the pattern matches, false otherwise.

B25__Title__c LIKE "[0-9]*" returns true if the title only contains numeric characters.

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.

NOT(ISBLANK(B25__Title__c)) returns FALSE if the title is empty

ISBLANK

Checks if a field or expression is blank (empty) or null. Returns true if it is blank, false otherwise

ISBLANK(B25__Title__c) returns TRUE if the title is empty

[index]

Array index operator. Returns the element at the specified index in a list (starting with zero). For example

matchingAvailabilities[0].B25__Unavailability__c would return true if the first matching availability is marked as an unavailability.

Functions

Some functions that return a number: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 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

...

  • IsNotAvailable() → 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 the condition is true, return the value of then, otherwise return the value of else.

You can filter records by using the filter function:

  • 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 listIteration of a list is also possible, for example to create a list of just numbers:

  • FOREACH(records AS record, record.number_field__c) -> yields a new list of the result of the formula of each record.

You Finally, you can combine the functions to create more in-depth 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 When you link your rule to a dimension, two special variables will become available to for use in the formula: .

  • overlapping_reservationsoverlappingReservations
    overlapping reservations with the reservation being checked
    COUNT(overlappingReservations) > 0
    No This rule would make sure that no overlapping reservation are allowed

  • matchingAvailablilities
    Allowing you to use the availablility availability or unavailablility unavailability of the related dimension in your formula.
    This list of B25__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.

Examples rules:

Note

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 = invalid
b25__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

Use custom permission in a rule

You can also reference and check the permissions of the running user in your rule.
By adding: $Permission.Custom_Permission_Name
COUNT(overlappingReservations) > 0 and $Permission.B25__ALLOW_DOUBLE_BOOKING == false

Example rules

Take a look at our example Conflict Rules

Example Conflict Rules

Features not supported by Conflict Rules