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 will start at the start of the Week or Month that Start is contained in.
The name of the Calendar record where the configuration should be loaded from.
One 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 the id of a parent resource is provided, all its children will also be loaded. This parameter overrides any user defined filters.
The Start date of the calendar. Should be in either the ISO 8601 format or the RFC 2822 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 user's device.
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
The id of a reservation. If provided the calendar will focus on this reservation and highlight it for 5 seconds.
Indicate 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 will not open correctly for users in Lighting Experience.
A 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. This can be useful for automatically linking new reservations to the record on which you are embedding the calendar.
If you include preserveIdOrder=true, the order of the ids passed in the recordId parameter will be maintained on the calendar. The default value is false, which means that the calendar applies its own ordering.
Multi Resource calendar page structure and naming
The Multi Resource Calendar consists of two separate pages:
The 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.
The 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.
Used for the resource calendar tab loads the calendar with the configuration of the calendar Named Resources
Used for the group calendar tab loads the calendar with the configuration of the calendar Named Groups
Used for the staff calendar tab loads the calendar with the configuration of the calendar Named Staff
Calendar page without the salesforce header loads the calendar with the configuration of the calendar Named Resources
Calendar page without the salesforce header loads the calendar with the configuration of the calendar Named Groups
Calendar page without the salesforce header loads the calendar with the configuration of the calendar Named Staff
Linking to a specific calendar
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/one.app#/alohaRedirect to the front of the URL.
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:
Go to theView recordthat specifies the week view on the Multi Resource Calendar and copy the unique identifier, for example: day
Go to Salesforce Setup and create a new button or link on the Reservation object
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.
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:
Build the JSON in VisualForce.
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:
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).