Embed Sheet in Layout using Visualforce

By applying the Visualforce page’s embedding feature to the Salesforce layout, you can embed the created sheet on the detail screen of any Salesforce record. This allows you to use Sheet as a multifunctional and editable related list.

Embed in Salesforce Classic Layout

Follow these steps to add a sheet to the layout in Salesforce Classic.

  1. Create a Visualforce page with only msmxSheet:SheetRedirect component as below

    • The example below is for embedding in the "Account" page. (If you embed it on a page other than "Account", replace the value of standardController with the API name of the appropriate object.)

    • For bookId andsheetId parameter, specify them referring to "Access Sheet Directly with URL".

<apex:page
  standardController="Account"
  showHeader="false"
>
<msmxSheet:SheetRedirect
  bookId="a002800000iNFMLAA4"
  sheetId="s1"
  recordId="{!$CurrentPage.parameters.id}"
/>
</apex:page>
  1. Specify the appropriate access permissions for the created Visualforce page.

  2. Open the layout setting page of the object, and place the created Visualforce page in the layout

Attributes that can be set in msmxSheet:SheetRedirect are as follows:

  • bookId - ID of the book containing the sheet to be displayed (required)

  • sheetId - ID of the sheet. The sheet ID value can be referenced from the sheet settings. If not specified, all sheets included in the book will be displayed as tabs

  • recordId - ID of the record to be the context. This ID value is used as the "Context Record ID" in the filter

  • nocache - Disable data caching when displaying sheets so that the data is always read from the server in refresh

Only msmxSheet:SheetRedirect component can be placed in a Visualforce page. Other components cannot be included.

Embed in Lightning Experience using Application Builder

In Lightning Experience, the "Sheet Component" can be used to display a sheet in a record page. Unlike embedding with Visualforce, the Sheet component is easy to set up and can be integrated into the page without being isolated in a rectangular frame, so the Sheet component is better in most cases.

Follow these steps to add a sheet to the record detail page in Lightning Experience.

  1. Create a Visualforce page as same as the example of embedding in Classic. Check the "Available for Lightning Experience, Lightning Communities, and the mobile app" option and save it.

  2. Specify the appropriate access permissions for the created Visualforce page.

  3. Open the detail page screen of the record you want to embed the sheet, select "Edit Page" from the setting menu at the top of the screen, and open the Lightning application builder page.

  4. Select "Visualforce" from Lightning components and drag and drop it to any area on the page.

  5. Set the property "Visualforce Page Name" to the name of the Visualforce page created in previous step. You can set "Label" and "Height" properties as you want.

Filter Setting for Embedded Sheet

In order for only those related to the record to be displayed in the sheet, it is necessary to properly set the filter for the sheet to be embedded beforehand. To set the filter for embedding, follow the procedure below.

  1. Add a column to the sheet with a reference ID field that refers to the object of the record page.

  2. Select "Filter" from the column menu of the column added in 1).

  3. In the Filter Settings dialog, click the "Select Reference Value" button to the right of the filter value input box to display the Select Reference Value dialog.

  4. Select "Context Record ID" as the reference type from the dialog, and apply the filter.

  5. If necessary, set the column added in 1) to be hidden.

Auto Relation Filling for New Record

When creating a new record in the embedded sheet, the ID of the record currently displayed is automatically filled to the reference ID field of the newly created record, as far as it meets the following conditions:

  1. The reference ID field in the column where the filter is set is a field that directly belongs to the primary object displayed in the sheet.

    • For example, when a sheet that lists Cases is displayed on the Account record page, a filter on the "Account ID" field will be applied, but filters on the "Account > Account ID" field or the "Parent Case > Account ID" field will not be applied.

  2. The reference ID field in the column where the filter is set is editable.

Last updated