Versions Compared

Key

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

...

After doing so, all conflict checking configured on the dimension itself, are disabled and only the rules will be used from now on.

Creating and editing rules

Navigate Go to the "Booking Restriction 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. If the formula is true, it will cause a conflict.

...

  1. 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. .

Note

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

...

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: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

Support some ways to filter a listYou 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_reservations
    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.
    COUNT(matchingAvailabilities) == 0
    Reservation not allowed when there is no availability or if there are unavailabilities.

...