Versions Compared

Key

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

...

  • make sure that bookable items are Included in the GoMeddo 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 in the Define Dimension Field section)

  • create calendars for bookable items that will show their reservations. This means you can show a calendar on a contact record page for example, on which you show in turn 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, GoMeddo 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?

...

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

Availability Lookup

Text

No

The API name of a lookup from the B25__Availability__c object to the dimension object.

Filling out this field allows you to define availabilities for the records belonging to this dimension. If this field is left blank, GoMeddo assumes your dimension is always available.

Sync Field

Text

No

Required for Google and Outlook synchronization. Please see the relevant articles here and here.

Use Shared Conflict Checking

Checkbox

Yes

Should be enabled for most use cases. When disabled, fields and junctions within this dimension don’t conflict with each other. More info here.

Double Booking Checking

Picklist

Yes

Defines how strictly GoMeddo should treat detected double bookings in this dimension. Required unless ‘Use Shared Conflict Checking’ is disabled. More info here.

Double Booking Matching Condition

Text

No

Should be blank for most use cases. Allows you to selectively apply double booking detection only to reservations matching this condition. More info here.

Define Dimension Fields

Next, we configure a way to link bookable items to reservations

  1. On the Reservation object, create a lookup to the object that holds the bookable items. In our example, this is 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)

  2. Make sure the field is part of the correct field set you will be using

  3. Go back to the Dimension you created in the previous section

  4. Go to the Related tab

  5. Click New in the Dimension Fields section

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

  7. Click Save

...

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:

  • Never - The field will not be populated

  • Only when on form - The field will only be populated if it is visible on the reservation form

  • Only when on form and required - Same as above but only if the field is required on the form

  • Always - The field will always be populated, even if it isn't visible on the form

Availability Checking

Picklist

Yes

Defines the behavior when Reservations are saved outside of the available times for the related dimension record.

  • None - Allow the Reservation to be saved

  • Soft - Allow the Reservation to be saved, but show a warning to the user and enter a Conflict record in the database

  • Hard - Don't allow the Reservation to be saved, and show an error message to the user

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.

  • None - Allow the Reservation to be saved

  • Soft - Allow the Reservation to be saved, but show a warning to the user and enter a Conflict record in the database

  • Hard - Don't allow the Reservation to be saved, and show an error message to the user

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.

  • None - Allow the Reservation to be saved

  • Soft - Allow the Reservation to be saved, but show a warning to the user and enter a Conflict record in the database

  • Hard - Don't allow the Reservation to be saved, and show an error message to the user

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.

...

Create a calendar

Create calendar config

Set up Calendars & Views

Create the actual calendar

Add a Calendar to a Lightning App Page

Tip

Done!

You are done as far as linking bookable items to your reservations in a 1-to-many fashion (via lookups) goes. If you proceed with the next section, you can build something similar for many-to-many relations (via junction objects).

...

Please be aware that a test class should be create which allows you to test this trigger. You can create a simple test class that inserts a reservation, a related object record and the dimension junction record. Here is an example that you can tweak to facilitate your use case

Code Block
languagejava
@IsTest
private class Test_B25_Reservation {

    @isTest private static void testDimensionJunctions() {
        B25__Reservation__c reservation = new B25__Reservation__c();
        reservation.B25__Start__c = DateTime.now();
        reservation.B25__End__c = DateTime.now().addHours(1);
        Database.insert(reservation);

        <YOUROBJECT>__c yourobject = new <YOUROBJECT>__c(); //replace this with the name of your object
        yourobject.Name ='a'; // if this is field is an auto number you dont need this.
        Database.insert(yourobject);

        Reservation_<YOUROBJECT>__c resYourobject = new Reservation_<YOUROBJECT>__c(); //replace Reservation_<YOUROBJECT>__c with the name of your dimension junction object
        resYourobject.Reservation__c = reservation.Id;
        resYourobject.<YOUROBJECT>__c = yourobject.Id; //replace this with the name of the lookup on the dimension junction
        Database.insert(resYourobject);

        System.assertEquals(1, [SELECT Id FROM B25__Reservation__c].size());
    }  
}

...

Display your Dimension Junctions on the Reservation Form

Displaying Dimension Junctions on the Reservation Form

Tip

Done!

Good job! You should now be able to add multiple bookable items to your reservations from the reservation form on the calendar! The sections below provide some additional information.

...

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.

  • None - Allow the Reservation to be saved

  • Soft - Allow the Reservation to be saved, but show a warning to the user and enter a Conflict record in the database

  • Hard - Don't allow the Reservation to be saved, and show an error message to the user

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.

  • None - Allow the Reservation to be saved

  • Soft - Allow the Reservation to be saved, but show a warning to the user and enter a Conflict record in the database

  • Hard - Don't allow the Reservation to be saved, and show an error message to the user

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.

...