A common use case for internal Enterprise Portals is to display the current leads pipeline in some way. This use case is so common that it is a perfect candidate for automation! This was the motivation behind the Liferay Salesforce integration portlet. In this blog post I will be discussing the Liferay Salesforce Leads portlet. This portlet is available in the Liferay Marketplace and has been tested with Liferay 6.2 CE & EE.
The Liferay Salesforce Leads portlet allows a user to list, search and view Salesforce lead details from the Liferay portal. This provides a read-only view into the leads pipeline for everyone in the organization.
In order to authenticate with Salesforce, we use OAuth2-based authentication to obtain a Bearer auth token. In turn, we use this token while fetching all the lead data from the Salesforce REST API. All the OAuth-related configuration is provided to the portlet through the portlet configuration.
Here’s a step by step guide to install and use use the Liferay Salesforce Leads Portlet from the Liferay Marketplace:
- Login to your Liferay portal as a Portal Administrator
- Go to Control Panel (This is usually available from the dockbar)
- Go to the Apps page
- Go to the Store page
- Login using your Liferay credentials
- Search for “Salesforce Leads” portlet
- Locate the portlet from Xtivia and click on the “Free” label in the app store
- Since this is a free portlet, you will be able download it.
- Once downloaded, install the app
- This portlet will now be available for use
In order to configure the Liferay Salesforce Leads portlet, please take a look at this small video. It explains how to configure the portlet.
The configuration has two parts:
- Setup a Connected Application within Salesforce
- Add the OAuth and User credentials to the portlet
To use Salesforce’s REST API, the portlet need to authenticate itself. This is done by getting a Bearer Token via the OAuth2 handshake. To establish that this portlet is a valid client, we first need to create a Connected Application within Salesforce. A Connected Application represents an external application that can interact with Salesforce. When a connected application is created, Salesforce generates a customer id and a customer secret. The portlet uses this id and the secret so that Salesforce knows the client is valid and trusted.
Here are step by step instructions on how to create a Connected Application in Salesforce.
Once you placed the portlet on a page, configure the following:
Client ID & Client Secret
Once the connected application is created, the customer id and the customer secret should be added to the portlet configuration as the “Client ID” and the “Client Secret” fields.
The portlet also needs a complete url (including the https and the version number of the API) in order to connect to in the first place.
Salesforce Username & Password
The Client ID and the Client Secret identifies this portlet as a valid client. The portlet then needs to login as a valid Salesforce user to fetch the leads data. Only valid users of the system can pull out data from API, so a valid Salesforce username and password should be added here.
This is the token for the user above. This is usually sent via email by Salesforce to the user’s email address.
Eventually we want to add more capabilities to this portlet, such as:
- state transitions to leads
- customize the list of fields that are shown in the search results and in the details page
- reporting features like plotting graphs for the number of new leads versus closed leads etc.
If you have any questions or ideas for enhancements, please reach out to us at: email@example.com