- Created by Jérôme Vincendon (Unlicensed), last modified on Mar 31, 2021
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 11 Next »
Introduction
Dimensions are things that you can book, such as a room, a person or a product. Out of the box, Booker25 provides dimensions for Resources, Staff, Groups and Contacts. The first 3 are custom objects, while the last one is the Salesforce standard Contact object. This article explains what you can do with dimensions, and how you can create your own.
By using dimensions, you can:
- make sure that bookable items are Included in the Booker25 conflict checking logic. More information about conflict detection: Conflict Checking
- make sure that you only add available items to your reservations by using intelligent lookups (more on this below)
- create calendars for bookable items that will show their reservations. This means you could show a calendar on a contact record page, on which you show in turn see that contact’s reservations. More information about calendars: Calendar Differences
Practical example
Imagine you have a fleet of cars and drivers. Your cars are stored in a custom Car object (Car__c), while your drivers are stored in the standard Contact object. You now want to track both your cars and drivers availability. As we mentioned earlier, Booker25 provides a Contact dimension, so you're all set as far as your drivers go. But how do you track your cars? And how do you make sure it does not cost you double work to track which car is assigned to which driver at each moment in time?
Simple! You create a Cars Dimension in Booker25. That way, when you create a reservation from either the driver or the car calendar, and link the other to it as well, Booker25 will draw that reservation on both calendar and keep both in sync at all times!
Technical overview
Dimensions are a powerful way of letting Booker25 know about records on any standard or custom object that are related to Reservations in, either through a lookup or via a junction object:
Through a lookup | The Reservation object has a lookup to the other object.
|
---|---|
Via a junction object | The Reservation object is linked to the other object through a third object, which has lookups to both Reservation and the other object. This Salesforce knowledge article explains what a junction object is. An example of this the Contact object, which is linked to Reservation through the ReservationContact junction object. ReservationContact has a lookup to Reservation and to Contact. |
Video example
For a more visual introduction to Dimensions and an example of how they work, please have a look at this video.
Define Dimensions
First, we start by telling Booker25 about the object that holds the bookable items
- Go to the Booker25 app
- Click on the Dimensions tab
Click New
Fill in the following field
Field Type Required Description Dimension Object Name Text Yes The API name of an object to which reservations are related.
Following the example, this would be Car__c
Define Dimension Fields
Next, we configure a way to link bookable items to reservations
- On the Reservation object, create a lookup to the Car__c object. (We won't go into too much detail on this one, as it's basic Salesforce admin knowledge)
- Go back to the Dimension you created in the previous section
- Go to the Related tab
- Click New in the Dimension Fields section
- The only field you currently need to fill in is Dimension Field Name, in which you fill in the API Name of the field you created in step 1 of this section
- Click Save
The following tables goes into more detail regarding the function of the other fields:
Field | Type | Required | Description |
---|---|---|---|
Dimension | Lookup | Yes | The Dimension record that is the parent of this Dimension Field. |
Dimension Field Name | Text | Yes | The API name of a lookup field on Reservation. |
Enable Advanced Lookup Filtering | Checkbox | No | Enables the advanced lookup filter on the reservation form for this dimension field. The advanced lookup filter allows you to use autocomplete to search through valid related records. It will only show records in which the current reservation will be valid. So for example meeting rooms in closed buildings or staff that are unavailable because of holiday or sick leave will not be shown. Or if you have added a service to the reservation, it will only show records in which that service is actually available during the time of the reservation. A known limitation of the advanced lookup filter is that it doesn't support custom lookup filters. |
Auto Populate on Calendar | Picklist | Yes | Controls if this dimension field gets populated with the related record id when creating a new reservation on the calendar. Options:
|
Availability Checking | Picklist | Yes | Defines the behavior when Reservations are saved outside of the available times for the related dimension record.
For more information, see this article about Conflict Checking, and this article about Availabilities |
Double Booking Checking | Picklist | Yes | Defines the behavior when double bookings are detected for Reservations in this Dimension.
For more information, see this article about Conflict Checking. |
Dimension Allow Double Booking Field | Text | No | The API name of a checkbox field1 on the related dimension object. When Enforce Double Booking Check is enabled, but this field on the related record equals true, the double booking is allowed. |
Reservation Allow Double Booking Field | Text | No | The API name of a checkbox field1 on reservation. When Enforce Double Booking Check is enabled, but this field on the reservation equals true, the double booking is allowed. |
Capacity Checking | Picklist | Yes | Defines the behavior when a Reservation's quantity exceeds the Dimension's capacity.
For more information, see this article about Conflict Checking. |
Dimension Capacity Field | Text | No2 | The API name of a number field3 on the related object, which holds the capacity of the related record. This capacity can't be exceeded if Enforce Capacity Check is enabled. |
Reservation Quantity Field | Text | No2 | The API name of a number field3 on the reservation, which holds the quantity of the reservation. This quantity is checked to not exceed the related record's capacity if Enforce Capacity Check is enabled. |
Reservation Skip Capacity Check Field | Text | No | The API name of a checkbox field1 on reservation. When Capacity Checking is set to 'Soft' or 'Hard', but this field on the related record equals true, the reservation will be saved normally. |
1: Can also be a cross-object reference or a checkbox formula on Reservation. However the latter will not be set yet when working from the Reservation Form UI.
2: Required when Enforce Capacity Check is enabled.
3: Can also be a number formula, and can also be a cross-object reference.
Define Dimension Junctions
Dimensions Junctions are a way to let Booker25 know which junctions between a dimension and a reservation are important.
A junction object is an object that sits in between two other objects (i.e. it has a lookup to each of the two objects). This creates a many-to-many relationship between those objects. For more information, see https://help.salesforce.com/articleView?id=relationships_manytomany.htm&type=5
An example of this would be a contact list, where you link multiple contacts to a reservation. Using dimension junctions you can:
- Make this list visible on the reservation form
- Make the reservation visible on the contact calendar for each contact in the list
- (Optional) Make Booker25 detect and prevent double bookings for these contacts.
Don't forget to implement the trigger hook described in the next section, or junction records will not be properly checked for conflicts.
There is an edge case where you can get an error like this: SObject row was retrieved via SOQL without querying the requested field: B25__Reservation__c.<junctions>__r (where <junctions> is your relationship name).
This error happens when you have both a field and a junction under the same dimension, both with Availability Checking: None. A workaround for this error is to give either the field or the junction Availability Checking: Soft or Availability Checking: Hard.
Field | Type | Required | Description |
---|---|---|---|
Dimension | Lookup | Yes | The Dimension record that is the parent of this Dimension Junction. |
Dimension Junction Name | Text | Yes | The API name of an object. This object should be a junction between reservation and the dimension. |
Reservation Lookup API Name | Text | Yes | The API name of a field on the object. This field should be a lookup (or master-detail) to Reservation. Make sure the actual field on the Junction object has the 'Allow reparenting: Child records can be reparented to other parent records after they are created' / 'Reparentable Master Detail' checkbox set to TRUE |
Dimension Lookup API Name | Text | Yes | The API name of a field on the object. This field should be a lookup (or master-detail) to the dimension. |
Availability Checking | Picklist | Yes | Defines the behavior when Reservations are saved outside of the available times for the related dimension record.
For more information, see this article about Conflict Checking, and this article about Availabilities |
Double Booking Checking | Picklist | Yes | Defines the behavior when double bookings are detected for Reservations in this Dimension.
For more information, see this article about Conflict Checking. |
Dimension Allow Double Booking Field | Text | No | The API name of a checkbox field1 on the dimension. When Enforce Double Booking Check is enabled, but this field on the related record equals true, the double booking is allowed. |
Reservation Allow Double Booking Field | Text | No | The API name of a checkbox field1 on reservation. When Enforce Double Booking Check is enabled, but this field on the reservation equals true, the double booking is allowed. |
Junction Allow Double Booking Field | Text | No | The API name of a checkbox field1 on the object itself. When Enforce Double Booking Check is enabled, but this field equals true, the double booking is allowed. |
1: Can also be a cross-object reference or a checkbox formula on Reservation. However the latter will not be set yet when working from the Reservation Form UI.
Create trigger hook
For every Dimension Junction you create, make sure you also create a Trigger for its object, which calls the following method: B25.DimensionJunctionTriggerHook.execute()
This makes Booker25 check permissions on the object. Make sure to replace <Dimension_Junction_API_Name> with the actual API name of your object, and <Trigger_Name> with a name that makes sense to you.
trigger <Trigger_Name> on <Dimension_Junction_API_Name> (before insert, before update, before delete, after insert, after update, after delete, after undelete) { B25.DimensionJunctionTriggerHook.execute(); }
Displaying Dimension Junctions on the Reservation Form
After you have configured Dimension Junctions (see Configuring Dimensions & Dimension Junctions) you might want display this Related List on the Reservation Form and allow users to add new records. To do this, you have to create a Dimension Junction Display Setting record on each Reservation Type you want to display this related list for. You can find this by going to the Reservation Type record and then to the Related tab.
The Dimension Junction Display Setting has some additional fields that allow you to control certain aspects of this related list.
Field | Type | Required | Description |
---|---|---|---|
Dimension Junction | Lookup | Yes | The dimension junction this Dimension Junction Display Setting displays |
Reservation Type | Lookup | Yes | The Reservation Type this Dimension Junction Display Setting displays this Dimension Junction on. |
Field Set to use | Text | No | The fieldset on the Dimension Junction object to use to display extra field in the dropdown section below each related item. If left blank the dropdown section is hidden. |
Order | Number | No | When multiple related lists are shown on the reservation form the related list with the lowest order wil be shown at the top. Blank values are treated as last. |
Hide Selected Items From Search Results | Checkbox | No | After selecting an item, it will no longer show up in the search results. |
Label | Text | No | The label that will be shown on the header of the section that contains this dimension junction list. When left empty the plural label of the dimension object is used. |
Use Bulk Input | Checkbox | No | Can be used to increase performance if junction validation is slow. Allows the user to first select multiple new junctions, and postpones validation until after the user clicks the Add button. |
Dimension Name Field | Text | No | The API name of the field to display as the name for each entry added to the list. The default value is 'Name'. If left empty, Booker25 will attempt to find a name field. Note: this setting is only supported on Lightning calendars. |
If you get an error when saving a reservation with junction records, double check if you have implemented the trigger hook described in the final section of Configuring Dimensions & Dimension Junctions.
Performance considerations
For performance reasons, it is good practice to only have the minimum number of Dimensions in your system, especially ones that are configured for conflict checking.
On this page: |
---|
- No labels