Integrating Salesforce with AEM provides lead management capabilities and leverages the existing capabilities provided out of the box by Salesforce. You can configure AEM to post leads to Salesforce and create components that access data directly from Salesforce.
The bidirectional and extensible integration between AEM and Salesforce enables:
- Organizations to fully use and update data to enhance the customer experience.
- Engagement from marketing to sales activities.
- Organizations to automatically transmit and receive data from a Salesforce datastore.
This document describes the following:
- how to configure Salesforce Cloud Services (configure AEM to integrate with Salesforce).
- how to use Salesforce Lead/Contact information in Client Context and for Personalization.
- how to use the Salesforce workflow model to post AEM users as leads to salesforce.
- how to create a component that shows data from Salesforce.
To configure AEM to integrate with Salesforce, you need to first configure a remote access application in Salesforce. Then you configure the salesforce cloud service to point to this remote access application.
You can create a free developer account in Salesforce.
The new configuration redirects to a new page: http://localhost:4502/etc/cloudservices/salesforce/developer.html. This is the exact same value that you need to specify in the Callback URL while createing the remote access application in Salesforce. These values must match.
Enter the Connected App Name, API Name, and Contact Email. Select the Enable OAuth Settings check box and enter the Callback URL and add an OAuth scope (for example, full access). The callback URL looks similar to this: http://localhost:4502/etc/cloudservices/salesforce/developer.html
Change the server name/port number and page name to match your configuration.
In AEM, navigate to Cloud Services and navigate to the salesforce configuration you created earlier (for example, developer). Click Edit and enter the customer key and customer secret from salesforce.com.
Login Url This is the Salesforce Authorization Endpoint. Its value is pre-filled and serves most cases. Customer Key Enter the value obtained from Remote Access Application Registration page in salesforce.com Customer Secret Enter the value obtained from Remote Access Application Registration page in salesforce.com
If you want to export an AEM user as a salesforce lead, you need to configure the workflow to post leads to salesforce.
To export AEM users as Salesforce leads:
Select the AEM user you want to create as a lead as the Payload for this workflow (home -> users). Be sure to select the profile node of the user as it contains information like givenName, familyName, and so on, which are mapped to Salesforce lead's FirstName and LastName fields.
Before starting this workflow, there are certain mandatory fields that a lead node in AEM must have before getting published to Salesforce. These are givenName, familyName, companyand email. To see a complete list of mapping between AEM user and Salesforce lead, see Mapping Configuration between AEM user and Slaesforce lead.
You may need to configure the Salesforce.com Export workflow to match it to the correct Salesforce.com configuration or to make other changes.
To configure the Salesforce.com export workflow:
To view or edit the current mapping configuration between an AEM user and a Salesforce lead, open the Configuration Manager: http://<hostname>:<port>/system/console/configMgr and search for Salesforce Lead Mapping Configuration.
The salesforce client context store shows additional information about the currently logged in user than what is already available within AEM. It pulls this additional information from Salesforce depending upon the user's connection with Salesforce.
To do this, you need to configure the following:
- Link an AEM user with a Salesforce ID via the Salesforce Connect component.
- Add the Salesforce Profile Data into the client context page to configure what properties you want to see.
- (Optional) Build a segment that uses the data from the Salesforce Client Context Store.
You need to map an AEM user with a Salesforce ID in order to load it in the client context. In a real-world scenario, you would be linking based on known user data with validation. For demonstation purposes, in this procedure, you use the Salesforce Connect component.
Navigate to a web site in AEM, sign in, and drag and drop the Salesforce Connect component from the sidekick.
If the Salesforce Connect component is not available, go to Design view and select it to make it available in Edit view.
This component is for demonstration purposes only. For real-world scenarios, there would be another process to link/match users with leads.
AEM ships with a sample Search component that searches leads in Salesforce according to the given criteria. This component shows you how to use the Salesforce REST API to search for salesforce objects. You need to link a page with a Salesforce configuration to trrigger a call to salesforce.com.
This is a sample component that shows you how to use the Salesforce REST API to query Salesforce objects. Use it as an example to create more complex component's based on your needs.