This QuickStart introduces you to Sigma embedding into Salesforce. This QuickStart assumes you have already taken the QuickStart Embedding 1: Prerequisites so that you have a sample environment to complete the tasks in this QuickStart.
We also recommend you take the the QuickStart Embedding 03: Secure Access.
Some steps may not be shown in detail as we assume you have taken these other two QuickStarts or are familiar with Sigma workflows.
Semi-technical users who will be aiding in the planning or implementation of Sigma. Limited Salesforce and technical data skills are needed to do this QuickStart. It does assume some common computer skills like configuring software, navigating folders and edit/copy/paste operations.
The exercises in this QuickStart will discuss and walk you through the steps to embed Sigma inside a Salesforce page.
We will build a Salesforce page using Sigma content, embedded securely on a VisualForce page as shown below:
In this use case we will embed a Sigma Dashboard based on one of the samples provided in the Sigma trial account. The high-level process looks like this:
Login to Sigma and navigate to the Administration
/ Developer Access
page.
Click the Create new
button:
Create new `Client Credentials as:
Copy the ClientID
and Secret
off to a text file. We will use them later on.
Navigate to the Templates
page.
Select Plugs Electronics Profit Planning Tool
.
Dismiss
the help popup and click the Dashboard tab (bottom of the page). This is the Page we want to embed.
Click the Save As button
(upper right corner). Name the Workbook Salesforce Embed
and click Save
.
Click the label Salesforce Embed
and select Embedding
:
Select Profit Planning Tool
to generate a URL for the single workbook page:
Click Copy
to copy the Embed Path URL and save it into a text file for later use.
Lastly, Share
the workbook with the Sales_Managers
team:
and...
Salesforce is very flexible but also can confuse non-administrative users who are trying to perform more advanced configuration. With that in mind we will just do a simple, secure embed. You will notice similarities to embedding from previous QuickStarts but also see things that are required by Salesforce.
Salesforce has its own language called "Apex" which is an object-oriented programming language created by Salesforce that allows you to extend the platform's existing functionality and create your own custom cloud-based software applications.
Apex is specifically designed for accessing and manipulating data. The method we will be using in Salesforce requires three objects to be configured:
Apex Class:
You can think of a class as a template containing all the necessary information and instructions that you can build upon and create class instances called objects. Sigma will use an Apex class to dynamically create the secure URL used by the iframe. You can use the Class to pass both required and optional parameters including pulling variables from the Salesforce session to pass through to Sigma to enable Row Level Security and other useful functionality. Row Level Security was covered in the QuickStart: Embedding 06: Row Level Security.
Visualforce Component:
This is a small, reusable piece of functionality—think widgets, panels, user interface elements, that kind of thing—that you use in Visualforce page markup. You can use standard Visualforce components in our case we will create a custom component for Sigma.
Visualforce Page:
The basic building block for application developers. A Visualforce page is similar to a standard Web page, but includes powerful features to access, display, and update your organization's data. We will embed Sigma into a Visualforce Page we will create.
In Salesforce, login (admin rights required) and navigate to Setup
using the gear icon
in the upper right corner:
In the left sidebar menu use Quick Find
to search for Apex Classes
and select that:
Click the New
button to create a new Apex Class:
Paste the following code into the class window. The Apex Class name is defined in the class code itself as SigmaEmbedClass
.
Click Save
.
In the left sidebar menu
use Quick Find to search for Visualforce
and select Visualforce Components
.
Create a new
one called SigmaEmbedComponent
and paste the following code into the window and save it:
Click Save
.
In the left sidebar menu use Quick Find to search for Visualforce
and select Visualforce Pages
.
Click Save
:
Test your work by editing the Visualforce Page
again and clicking Preview
:
If you have done everything correctly, the Sigma Sales Dashboard page should appear as:
In the event the Insufficient Privileges
error appears, the Visualforce page has to be shared with the profile:
Please refer to this Salesforce document to resolve the issue.
Now that we have a working embed, we can add this Visualforce page anywhere we want in Salesforce.
If you are using Salesforce Lightning you will need to click this checkbox on in your Visualforce page or you will not be able to add it to pages:
Navigate to a page that you want to embed onto. We will go to Sales
/ Home
. Click Edit Page
:
Depending on the page you select, you may want to remove existing Components or just add to it. In our case, we removed the existing content (using the small trash can in the upper right corner of the Component) and clicked the Add Component(s) Here
button and selected Visualforce
from the left sidebar menu:
We can then select SigmaSales
from the right side menu as shown:
We will want to set the Height to 800
so that the Component is taller on the page:
Click Save
.
Navigate back to the Sales homepage (or the page where you decided to embed) and see the results:
In this QuickStart we embedded a Sigma Dashboard securely into a SalesForce VisualForce page, building on the lessons in previous embedding QuickStarts.
Additional Resource Links
Be sure to check out all the latest developments at Sigma's First Friday Feature page!