Get more content like this

Integration of Adobe AEM-5.6.1 and Salesforce

Adobe AEM-5.6.1 and Salesforce Integration

We recently finished integrating Adobe Experience Manager with Salesforce. In this integration, a lead generated from the website will go through a workflow and is finally pushed to Salesforce. Let us go through the main steps in doing the integration and issues encountered on the way.

Integration Steps:

  • In Salesforce Admin panel create connected App.
  • Create Cloud Service configuration for Salesforce in Adobe AEM 5.6.1. Use Salesforce provided Consumer Key and Consumer Secret while creating the configuration.
  • Modify the Salesforce.com workflow to suit your business process for validating the lead. As a final step you would post the lead to Salesforce.
  • Create your website form which act as the source of leads. Once a visitor submits the form, create node in AEM with the data and initiate the workflow with the newly created node as the payload. Recommended path for creating the leads would be /etc/forms/<website>/<form name> /<alphabet>
salesforce 

Issues:

  • While trying to publish data from Adobe AEM to Salesforce we got java Exceptions and after debugging we found issue with the “AEM-mcm-salesforce-1.0.6.jar”. The java code in the “AEM-mcm-salesforce-1.0.6.jar” is looking for two properties “instanceurl”,”accesstoken” under the path  /etc/cloudservices/salesforce/apr8/jcr:content”. Updating  SalesForceSecretServlet.java as given below fixed the issue.

if(redirectUri != null && redirectUri.length() > 0)

{

String nodePath = (redirectUri.substring(redirectUri.indexOf("/etc/"), redirectUri.length()-5 ));

if(nodePath != null && nodePath.length() > 0)

{

ResourceResolver resourceResolver = request.getResourceResolver();

Session session = (Session)resourceResolver.adaptTo(Session.class);

Node configNode = session.getNode(nodePath).getNode("jcr:content");

String accessToken = responseBody.getString("access_token");

String instanceUrl = responseBody.getString("instance_url");

if(accessToken != null)

configNode.setProperty("accesstoken", accessToken);

if(instanceUrl != null)

configNode.setProperty("instanceUrl", instanceUrl);

configNode.getSession().save();

}

}

If you would like more help optimizing or Integration your AEM Reach Us Today.

Need help powering your website with Adobe?

Get In Touch