Skip to content

Instantly share code, notes, and snippets.

@MashmatrixSupport
Last active May 24, 2019 14:23
Show Gist options
  • Save MashmatrixSupport/ca1876f07ea19914b4e683309ccfdd27 to your computer and use it in GitHub Desktop.
Save MashmatrixSupport/ca1876f07ea19914b4e683309ccfdd27 to your computer and use it in GitHub Desktop.
Sheet-Embeded Visualforce Page
<apex:page
standardController="Account"
showHeader="false"
>
<script>
var bookId = "a002800000iNFMLAA4";
var sheetId = "s1";
var url =
"{!URLFOR($Page.msmxSheet__MsmxSheetView)}" +
"?bookId=" + bookId + "&sheetId=" + sheetId;
var recordId = "{!$CurrentPage.parameters.id}";
if (recordId) { url += "&id=" + recordId; }
location.href = url;
</script>
</apex:page>
@MashmatrixSupport
Copy link
Author

MashmatrixSupport commented May 24, 2019

To embed a sheet in the Account record detail page:

  1. Click "New Book" button, input "Opportunities" in the book name field, and select Opportunity object as a data source. New book will be created with one sheet tab named "Opporunity".
  2. In the "Opportunity" sheet, select "Add Columns" from the right-most column header menu, and add a column with field "Account ID".
  3. Select "Filter" from the column header menu of the newly added "Account ID" column, and select "Context Record ID" in ID Reference picklist.
  4. Open the setting of "Opportunity" sheet, copy the book ID information.
  5. Create a Visualforce page with above content, by replacing all bookId value to the copied book ID, check "Available in Lightning Experience" checkbox, and click "Save".
  6. Open an Account record detail page, choose "Edit Page" from the menu in the Setup menu.
  7. Drag the "Visualforce" component from Lightning Components library, drop onto the content of the page.
  8. Choose the newly created Visualforce in "Visualforce Page Name", change to acceptable height of the sheet.

https://www.youtube.com/watch?v=KkUULBccmZM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment