Versions Compared

Key

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

The callable class has two parameters: a String specifying the action, and a Map<String, Object> with parameters.
For the custom context menu the action will be contextMenu.
The parameter map will contain one entry defaultContextMenu. This entry is a List of context menu items.

A single context GoMeddo calendars come with a customizable context menu, that users can access by clicking on the triple dots while hovering over a dimension row header:

...

This article explains what the default items are and how they can be customized.

Default Menu Items

By default, the context menu consists of the following items:

Name

Type

Description

Additional conditions

ViewInSalesforce

Url

Opens the dimension record in the standard Salesforce UI

None

ViewInBooker25

Url

Opens the dimension record in the GoMeddo Resources & Types tab

Dimension B25__Resource__c and booker25AdminsOnly1

ExpandReservationGroups

Action

Expands any reservation groups in the selected dimension record.

Only visible if there are collapsed groups in the dimension record row2

CollapseReservationGroups

Action

Collapses any reservation groups in the selected dimension record.

Only visible if there are expanded groups in the dimension record row2

PinRowToTop

Action

Pin the dimension record row to the top of the calendar.

Only visible if the dimension record row is not pinned

UnpinRowFromTop

Action

Unpin the dimension record row from the top of the calendar.

Only visible if the dimension record row is pinned

1: See the menu item properties availableForDimensions and booker25AdminsOnly below.
2: For more info on collapsible dimension groups, see: Dynamic Dimension Grouping

Customizing the Menu

To customize the menu, two steps need to be taken:

  1. Create your Apex class

  2. Configure GoMeddo to use your class

Create your Apex class

First, create your Apex class. This class must be global and implement the Salesforce Callable Interface. Also see the Example Class below.

When a user opens the context menu on the calendar, your implementation of the call method will be called with the following parameters:

Parameter

Type

Value

action

String

This value will always be “contextMenu”, unless you are reusing this class for other implementations (not recommended)

args

Map<String, Object>

This map will contain one entry “defaultContextMenu”, and its value will be a list of menu items List<Map<String, Object>>(explained below)

When called, your implementation of the call method is expected to return a list of menu items, which is a List<Map<String, Object>>.

Menu Items

A single menu item is a Map<String, Object> with the following keys:

Key

name

Type

Value

Description

uniqueId

String

Unique id. Not required but

provided for

allows you to identify the default items

so they can be identified

.

label

String

The label shown in the context menu.

urlTemplate

String

The url that should be opened if the user clicks this item. This template can include a merge field {dimensionRecordId}. This will be replaced with the id of the dimension record the user selected.

hideIfNotReservable

Boolean

If true the entry will not be shown on non reservable dimension objects.

booker25AdminsOnly

Boolean

If true the entry will only be visible if the user has the B25_Admin permission set.

availableForDimensions

List<String>

The names of the dimensions where this entry should be

show

shown. If left empty it will be shown on all dimensions.

isBooker25CustomAction

Boolean

Some GoMeddo actions are not just opening urls for these this property will be set to true and GoMeddoCustomAction will be set to specify the custom action.

You can not add additional custom actions but any context entries with this property set to true and an existing custom action selected will work.

booker25CustomAction

String

The custom action this

button

item should run. Currently

two

four different actions are available:

  • expandReservationGroups will expand any groups of reservations that are collapsed and will only be visible if there are any collapsed groups.

  • collapseReservationGroups will collapse any expanded reservation groups and will only be visible if there are any expanded groups.

Default context menu

The default context menu consists of the following items

...

unique id

...

Type

...

Additional conditions

...

Description

...

SingleCalendarLink

...

Url

...

hideIfNotReservable

...

Opens the single calendar for the selected dimension record.

...

ViewInSalesforce

...

Url

...

None

...

Opens the dimension record in Salesforce

...

ViewInBooker25

...

Url

...

Dimension B25__Resource__c and booker25AdminsOnly

...

Opens the dimension record in the GoMeddo UI

...

ExpandReservationGroups

...

Action

...

Only visible if there are collapsed groups in the dimension record row

...

Expands any reservation groups in the selected dimension record.

...

CollapseReservationGroups

...

Action

...

Only visible if there are expanded groups in the dimension record row

...

Collapses any reservation groups in the selected dimension record.

...

  • pinRowToTop will pin the row at the top of the calendar and will only be visible if the row is not pinned.

  • unpinRowFromTop will unpin the row from the top of the calendar and will only be visible if the row is pinned.

Configure GoMeddo to use your class

After you’ve created your class, configure GoMeddo to use it.

  1. Go to Setup > Custom Settings

  2. Find the entry named ‘System Settings’ contained in the B25 package.

  3. Click Manage to the left of the ‘System Settings’ entry.

    Image Added
  4. Create a new Setting named ‘Calendar Context Menu Class’.

  5. Set the String Value to the name of the class you created.

  6. Save the setting.

    Image Added

Example Class

This example updates the ‘View Calendar’ link to go to a specific calendar implementation with uniqueName customSingleCalendar.

...