Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

In order keep configuration simple, please perform the following steps in Salesforce Classic (Booker25 is Lightning-Ready, you may afterwards use the app in Salesforce Lightning as you please)

When working with the Multi Resource Calendar, you might want to link to a specific calendar directly. This is possible using URL parameters with the Multi Resource Calendar.

Multi Resource Calendar page parameters

While the Start parameter does specify where the calendar starts, if the view being linked to is 'Week' or 'Month', the page being displayed wil start at the start of the Week or Month that Start is contained in.

Parameter NameRequired?Description
recordIdNoOne or more ID's of the Resource, Staff or Group records you want to display the calendar for. These resources should exist and be non Virtual and of the same type as the calendar. If a non rentable resource is provided the subtree of this resource wil also be loaded. This parameter overrides any user defined filters.

The Start date of the calendar. Should be in format


The time part is optional, but can be included to allow for easy use of DateTime fields. Special value TODAY will set Start to the current date of the computer looking at the calendar


The unique name of a View that is attached to the calendar of the type of Resource being displayed. if the view could not be found, the default View wil be selected

rsvNoThe id of a reservation. If provided the calendar wil focus on this reservation and highlight it for 5 seconds.
calendaryesThe name of the calendar record where the configuration should be loaded from.
lightningNoIndicate if Booker25 is running in Lightning Experience context or not. Pass true if in Lightning Experience and false otherwise. This is required, because when Booker25 is embedded it has no way of detecting this context by itself. If not passed, Booker25 wil assume Classic context, and links to Visualforce pages wil not open correctly for users in Lighting Experience.
prototypeReservationNoA JSON object that represents a reservation. This reservation will be used as a template when new reservations are created on the calendar. This allows you to pre-populate fields based on what calendar they are created on. For example set the opportunity field based on the opportunity detail page the calendar is embedded into.

Multi Resource calendar page structure and naming

The Multi Resource Calendar consists of two separate pages:

Page namedescription
B25__MultiResourceCalendarWrapperThe main page for the Multi Resource Calendar. This page includes the Salesforce header and looks like a Salesforce page. Use this in your URL when linking to the calendar in both Salesforce Classic and Lightning.
B25__MultiResourceCalendarThe page wrapped by B25__MultiResourceCalendarWrapper. This page contains all the actual logic for the Multi Resource Calendar. Use this page when embedding the calendar in a detail page, or somewhere where the Salesforce header is already on the page.

Older versions of booker25 used different pages and three of these pages are still used for the resource staff and group tabs.

Page namedescription
classic_calendarUsed for the resource calendar tab loads the calendar with the configuration of the calendar Named Resources
ClassicGroupCalendarUsed for the group calendar tab loads the calendar with the configuration of the calendar Named Groups
ClassicStaffCalendarUsed for the staff calendar tab loads the calendar with the configuration of the calendar Named Staff
lightning_calendarCalendar page without the salesforce header loads the calendar with the configuration of the calendar Named Resources
GroupCalendarCalendar page without the salesforce header loads the calendar with the configuration of the calendar Named Groups
StaffCalendarCalendar page without the salesforce header loads the calendar with the configuration of the calendar Named Staff

Linking to a specific calendar

Lightning Considerations

When linking to the multi resource calendar from Lightning Experience, loading the page might result in the page opening without the Lightning header. When this happens append /one/ to the front of the URL.

Doing this,




You can link to a specific calendar by specifying the View and Start date in the URL. For example, to create a link to the calendar from a Reservation detail page that wil show the Multi Resource Calendar on the week where the reservation starts proceed as follows:

  1. Go to the View record that specifies the week view on the Multi Resource Calendar and copy the unique identifier, for example: day
  2. Go to Salesforce Setup and create a new button or link on the Reservation object
  3. The URL to be used in this example would be

  4. Save the new link and add it to the Reservation Page Layout
  5. The button / link should open the calendar on the week that the reservation starts, for the resource the reservation was made in.

Specifying multiple recordIds

You can specify multiple record ids to display on the calendar, to do this separate the record ids using commas for example:


Embedding the Multi Resource Calendar in a VisualForce page

It is possible to embed the Multi Resource Calendar into your own VisualForce pages and in the detail pages in the standard Salesforce ui.

In this example, we will show how to make a page that can be embedded into a Contact detail page. This Contact record has a lookup to the Staff record that represents this Contact, named Staff__c. This page will show the Contact's calendar for the current week.

This example page allows you to set the parameters on a javascript object and let booker25 handle parsing the url and passing the extra parameters down to the calendar.

ContactDetailCalendar visualforce page
<apex:page showHeader="false" sidebar="false" applyBodyTag="false" standardController="Contact">
        html,body{height:100%}{height:100%;width:100%;position:absolute;top:0;bottom:0;left:0;right:0}html body.sfdcBody{padding:0 !important}#contentWrapper{height:calc(100% - 152px)}.outerNoSidebar{height:100%;padding:0 !important}.noSidebarCell{padding:0 !important}.bodyDiv{overflow:hidden !important}
    <iframe id='page-iframe' class="page-iframe" src="" frameborder="0"></iframe>
    	var baseUrl = "{!$Page.B25__MultiResourceCalendar}";
    	var parameters = {};
    	parameters.recordId = '{!Contact.Staff__c}';
    	parameters.start = 'TODAY';
    	parameters.calendar = "Staff";
    	var d=function(){var e={},;return a?(a.split("&").forEach(function(a){var r=a.split("=");1===r.length?e[r[0]]="":e[r[0]]=decodeURIComponent(r[1])}),e):e},f=function(e){var a="";for(var r in e)e.hasOwnProperty(r)&&(a+=a?"&":"?",a+=r+"="+encodeURIComponent(e[r]));return a},r=function(e,a){if(!c()&&"undefined"!=typeof history&&void 0!==history.replaceState){if(window.location!=window.parent.location&&"function"==typeof window.parent.postMessage){var r={cmd:"B25::updateParameter",parameter:e,value:a};window.parent.postMessage(r,"*")}var t=d();t[e]=a;var n=f(t),o=document.location.pathname+n;history.replaceState({},"",o)}},c=function(){return"undefined"!=typeof sforce&&void 0!},t=function(e){e.origin===window.location.origin&&"object"==typeof"B25::updateParameter",};window.addEventListener("message",t,!1);var n=d();for(pro in parameters)parameters.hasOwnProperty(pro)&&parameters[pro]&&(n[pro]=parameters[pro]);var o=f(n),i=document.getElementById("page-iframe");i.src=baseUrl+o;

Note how we used the B25__MultiResourceCalendar instead of B25__MultiResourceCalendarWrapper, to avoid the standard Salesforce header being shown within the Contact detail page. Also passing TODAY to the start parameter is optional, since when no parameter is passed it defaults to the current date.

Specifying a prototype reservation

When creating a Reservation on an embedded calendar, you may pre-populate fields on the Reservation with information from the record on which the calendar has been embedded. Booker25 does this by creating a "Prototype Reservation".

There are multiple ways to build the JSON required for the Prototype Reservation:

  1. Build the JSON in VisualForce.
  2. Build the JSON in a controller

Build the JSON in VisualForce

Using the code snippet below, and on a VisualForce page that references the Contact Standard Controller, you can create a JSON object in VisualForce using the fields on the Contact object:

parameters.prototypeReservation = '{"B25__Contact__c" : "{!Contact.Id}"}';

Build the JSON in a controller

For a more complex Prototype Reservation, you can define a Controller Extension and then output the Reservation JSON on the page:

public class EmbededOpportunityCalendarExtension {

    private final Opportunity opp;
    public EmbededOpportunityCalendarExtension(ApexPages.StandardController stdController) {
		// Add the fields required for the reservation prototype
        stdController.addFields(new List<String>{'AccountId', 'Probability'});
        this.opp = (Opportunity) stdController.getRecord();

    public String getPrototypeReservation() {
        B25__Reservation_Status__c reservationStatus = EmbededOpportunityCalendarExtension.getReservationStatusBasedOnProbability(this.opp.Probability);
		B25__Reservation__c prototypeReservation = new B25__Reservation__c(
			B25__Opportunity__c = this.opp.Id,
			B25__Account__c = this.opp.AccountId,
			B25__Status__c = reservationStatus.Id
        return JSON.serialize(prototypeReservation);

	private B25__Reservation_Status__c getReservationStatusBasedOnProbability(Decimal probability) {
        String statusName = '';
		if (probability > 75) {
            statusName = 'Definite';
        } else {
            statusName = 'Option';
        return [SELECT Id FROM Reservation_Status__c WHERE Name= :statusName];

Output on the VisualForce page that references the Opportunity Controller Extension:

parameters.prototypeReservation = '{!prototypeReservation}';

Bookmarking calendars and linking calendars

This functionality only works in Salesforce Classic due to Salesforce limitations.

The Multi Resource Calendar can be bookmarked and linked, as the app keeps the URL up to date with the current the View and Start parameters. This means that if you copy the current URL and distribute it to other users, they wil get the same calendar you are viewing (if they are logged in to Salesforce and their Permissions allow for this).

On this page

  • No labels