Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

S4S can be used to sync Salesforce field values into to Sitecore contact facets.

The following code sample is an example of how to retrieve Salesforce entities using a SOQL query and set the values into to Sitecore contact facets. This can be extended into a complex solution to cater to any kind of sync scenario between Salesforce entity fields and Sitecore contact facets depending on your requirements.  

...

  • You need to define a valid SOQL query according to your requirements to return any number of fields. Make sure to include all the Salesforce fields which you would like to map into Sitecore facets in this SOQL query.

  • The code sample that maps the Salesforce fields to Sitecore contact facets is below. The This example writes Salesforce field values into the “Personal” and “S4SInfo” facets in the Sitecore contact.

As mentioned, this can be changed to meet your requirements by changing To meet another requirement, change the SOQL query to retrieve the relevant Salesforce fields then mapping map them to any type of Sitecore contact facet.

...

  • The code sample uses Sitecore alias id to retrieve the Sitecore contacts. The Sitecore alias id recognizes the same individual arriving on the website from different devices and is compatible with S4S out-of-the-box form save action scenarios, S4SLB, and personalization. Again, you can change this according to your requirements.

...