Versions Compared

Key

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

GoMeddo comes with a number of calendar components that can be included in your Lightning solutions. One way to include them is through the Lightning App Builder, through drag & drop. Doing so is fast and easy, but only lets you control certain attributes of the component. If you want more control over the calendars, you can consider wrapping them in your own custom components. This article explains how.

B25:multiCalendarWrapper

...

Property

...

Expected Value

...

Description

...

calendarId*

...

The Name of a Calendar record.

...

This sets the configuration based on the linked Calendar record.

...

view

...

The Unique Identifier of a View record.

...

This sets the currently displayed view. Make sure to choose a View record that is linked to the Calendar record, otherwise this property will be ignored.

...

startDate

...

A date string in almost any kind of format.

...

This sets the start date of the currently displayed view.

...

prototypeReservation

...

An object that represents a Reservation record.

...

Allows you to prepopulate fields on new reservations being created on the calendar, even if that field is not displayed on the reservation form.

Note: you can include junctions (such as ReservationContacts) or service reservations in the prototype.

...

maxHeight

...

An integer.

...

The maximum pixel height that the calendar will stretch to. If the content is larger, a scroll bar will be shown.

...

hiddenDimensionFilters

...

A list of filter objects.

...

Sets filters on the dimension records shown in the calendar. These filters are not visible to users.

See Passing Hidden Filters below.

...

hiddenReservationFilters

...

A list of filter objects.

...

Sets filters on the reservation records shown in the calendar. These filters are not visible to users.

See Passing Hidden Filters below.

...

filterIdentifierPrefix

...

A string.

...

Any calendars with the same filterIdentifierPrefix will share saved filters. By default the name of the calendar record is used. This allows you to share filters between calendars or have separate filters for the same calendar.

...

unfilteredDimensionIds

...

A list of record ids.

...

Allows you to limit the dimension records that are displayed on the calendar. Any additional filters will never allow records outside of this list to be displayed.

...

isReadOnly

...

Boolean

...

When this property is set to true, the calendar does not allow the users to create or modify reservations. It will only display the reservations that are in the system.

...

availabilityFilteringEnabled

...

Boolean

...

When enabled all dimension records that are fully unavailable in the current view will be hidden.

...

mdaContext

...

MDAContext

...

Context for filtering MDavailabilities.

\* This property is required.

Code Sample

Below is a basic aura component that can be included on a Lightning Record page. This component shows a week view starting at a specific date, and sets the Staff lookup to a the staff record this component is placed on.

When copying this sample, keep a few things in mind:

  • If you want to display a different calendar, make sure to pass an existing calendar name to calendarId

  • Make sure that the referenced calendar is of record type Multi Resource Calendar

  • Make sure that the string passed to view is the unique identifier of a view that is linked to the selected calendar

Component

Code Block
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="recordId" type="String" />
    <aura:attribute
        name="myPrototypeReservation"
        type="B25__Reservation__c"
    />
    <B25:multiCalendarWrapper
        calendarId="Resources"
        view="weekView"
        startDate="2020-12-31"
        prototypeReservation="{!v.myPrototypeReservation}"
    >
    </B25:multiCalendarWrapper>
</aura:component>

Controller

...

Code Sample (example)

Below is a basic Aura Component that can be included on a Lightning Record page. This component shows a Week view (view="weekView"), starting at a specific date (startDate="2020-12-31"), and sets the Staff lookup to a the staff record this component is placed on (prototypeReservation="{!v.myPrototypeReservation}, which calls the Controller below it)

This is just an example. When copying this sample, keep a few things in mind:

  • If you want to display a different calendar, make sure to pass an existing calendar name to calendarId

  • Make sure that the referenced calendar is of record type Multi Resource Calendar

  • Make sure that the string passed to view is the unique identifier of a view that is linked to the selected calendar

  • Make sure to change the lookup to the one you are using

Component

Code Block
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="recordId" type="String" />
    <aura:attribute
        name="myPrototypeReservation"
        type="B25__Reservation__c"
    />
    <B25:multiCalendarWrapper
        calendarId="Resources"
        view="weekView"
        startDate="2020-12-31"
        prototypeReservation="{!v.myPrototypeReservation}"
    >
    </B25:multiCalendarWrapper>
</aura:component>

Controller

Code Block
({
	doInit : function(component, event, helper) {
        component.set("v.myPrototypeReservation", {
            sobjectType: 'B25__Reservation__c',
            B25__Staff__c: component.get('v.recordId')
        });
	}
})

Properties

The following properties can be used:

Property

Expected Value

Description

calendarId*

The Name of a Calendar record.

This sets the configuration based on the linked Calendar record.

view

The Unique Identifier of a View record.

This sets the currently displayed view. Make sure to choose a View record that is linked to the Calendar record, otherwise this property will be ignored.

startDate

A date string in almost any kind of format.

This sets the start date of the currently displayed view.

prototypeReservation

An object that represents a Reservation record.

Allows you to prepopulate fields on new reservations being created on the calendar, even if that field is not displayed on the reservation form.

Note: you can include junctions (such as ReservationContacts) or service reservations in the prototype.

maxHeight

An integer.

The maximum pixel height that the calendar will stretch to. If the content is larger, a scroll bar will be shown.

hiddenDimensionFilters

A list of filter objects.

Sets filters on the dimension records shown in the calendar. These filters are not visible to users.

See Passing Hidden Filters below.

hiddenReservationFilters

A list of filter objects.

Sets filters on the reservation records shown in the calendar. These filters are not visible to users.

See Passing Hidden Filters below.

filterIdentifierPrefix

A string.

Any calendars with the same filterIdentifierPrefix will share saved filters. By default the name of the calendar record is used. This allows you to share filters between calendars or have separate filters for the same calendar.

unfilteredDimensionIds

A list of record ids.

Allows you to limit the dimension records that are displayed on the calendar. Any additional filters will never allow records outside of this list to be displayed.

isReadOnly

Boolean

When this property is set to true, the calendar does not allow the users to create or modify reservations. It will only display the reservations that are in the system.

availabilityFilteringEnabled

Boolean

When enabled all dimension records that are fully unavailable in the current view will be hidden.

mdaContext

MDAContext

Context for filtering MDavailabilities.

\* This property is required.

B25:singleCalendarWrapper

...

\* This property is required.

Code Sample

Below is a basic aura component that can be included on a Lightning page. This component shows a week view starting at a specific date, and sets the Staff lookup to a specific record.

...

\* This property is required.

Code Sample

Below is a basic aura component that can be included on a Lightning page. Sets the Title lookup to a specific value.

...