You are on page 1of 19

AUTOMATE SALESFORCE.

COM WITH A DRUPAL INTEGRATION

DRUPAL SPOTLIGHT:

AUTOMATE
SALESFORCE.COM WITH
A DRUPAL INTEGRATION

FUNCTIONALITY GAPS
SOLVED THROUGH
CONTINUOUS
SYNCHRONIZATION


by: Dagoberto Aceves
Senior Engineer

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Dagoberto Aceves

Dagoberto is a Senior Drupal


Developer at Achieve, with a
strong role supporting projects
requiring integration to third party
systems. With widespread
experience in several mainstream
web application frameworks
including Spring, Ruby on Rails,
CakePHP and 5+ years with
Drupal, Dagoberto believes there
is no single solution to any one
problem, but he feels that Drupal
is a great step in the right direction
for most web application needs.
You can check out his Drupal.org
profile at dago.aceves.

//"page"1"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Introduction: Open Source Solution


Drupal provides you with a solid and flexible platform for integrating a wide
variety of services and capabilities with your online presence. Since Drupal
is an Open Source Content Management System (CMS), it can be
customized to meet almost any integration need you may have.

By providing a solid architecture and Application Programming Interface
(API) system, Drupal allows experienced developers to create custom
extensions to the system, called modules, based on your specific
business needs.

A common need for many organizations is integrating the Drupal platform
with Salesforce.com, the powerful Customer Relationship Manager (CRM)
that includes prebuilt applications for orchestrating business relationships
between clients, leads, and contacts.

Despite the ability to customize the prebuilt Salesforce.com applications,
many companies find a gap still exists when it comes to complete
integration. Certain functionalities may be non-existent, unsupported or
unsatisfactory on the Salesforce.com side.

First, we explain how the underlying technology works behind the
integration. Then we show you how Drupals Salesforce module can be
elegantly modified to provide complete, customized Salesforce
functionality within Drupal to meet your enterprise requirements.

//"page"2"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Achieve at a Glance
Achieve Internet has been developing websites using Drupal since 2005.
We have been using Drupal as our primary toolset and have one singular
goal that we strive to accomplish on every project and that is to help our
clients launch their advanced digital platforms with confidence. We have
been doing this for a great number of clients in an array of market verticals,
from Media, Entertainment, Publishing and most recently Healthcare. Our
growth strategy is always evolving and our influences are always changing.
However, the one thing that has remained constant is our talent and
innovative development methodology. Additionally, our team of in-house
engineers has over 90,000 Drupal development hours and counting and
through our meticulous and forthright development process we
consistently exceed client expectations.

This level of excellence has allowed us to venture into areas of great
uncertainty, from development challenges to new verticals with unique
opportunities. Our development team revels in the challenges of new
projects and unique integrations and customizations that our clients ask
from us. We have performed numerous Salesforce.com integrations for
many of our clients and have become experts in the custom integration
steps necessary and we wanted to share the knowledge with the rest of the
Open Source Community.

In this paper, we focus on one specific area of integration:
successfully bridging functionality gaps in Salesforce.com through
continuous synchronization with a Drupal environment.

//"page"3"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Technology Basis for Integration


Salesforce SOAP Web Services
Salesforce currently leverages Simple Object Access Protocol
(SOAP) web services to implement its outward facing API. The
Salesforce SOAP API can be used to create, retrieve, update and
delete records, including Accounts, Opportunities, and Custom
objects. The functionality also includes password maintenance
and custom queries. The SOAP web service is a proven protocol
for exchanging information between systems.

SOAP is one of several web services that Drupal supports
both as a Service and as a Client endpoint.

The SOAP protocol is a recognized international standard
managed by the World Wide Web Consortium (W3C). It is
important to note that while Salesforce uses SOAP, not all third
party CRM integrations require the use of SOAP. Most other PHPsupported services have supported Drupal modules or can be
easily integrated into the Drupal environment.

//"page"4"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Pushing New Objects From Drupal


to Salesforce via SOAP API
1.

Existing user or node on Drupal has


unique identifier (nid or uid).

2. Drupal requests an object creation with


Salesforce via the SOAP API. The Object
Field Mapping is used to define the details
of the request, which identifies the fields to
be set for the new Salesforce object.

3. Salesforce response includes the Salesforce ID (SFID)


for the new object created. This is saved on Drupal
and is linked to the Drupal Object using the
Salesforce Object Map
4. Drupal stores the local user id
(uid) and Salesforce Contact ID
(SFID) to the database.

//"page"5"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Salesforce Suite Module


The Primary Drupal Integration Tool
Drupal's primary implementation of the Salesforce API is via the
Salesforce Suite. The Salesforce Suite is a collection of modules
that work in concert to provide a robust integration between
Drupal entities (Nodes, Users, etc.) and Salesforce data objects
(Accounts, Contacts, Opportunities, etc.).

The Salesforce Suite modules operate independently of each
other and have one central Salesforce API module acting as a
gateway to the remote Salesforce operations. Additionally, the
Salesforce API module provides an administration screen to
create object mappings between Drupal and Salesforce. The
remaining modules use the Salesforce API modules features to
save data from Salesforce objects to their corresponding Drupal
counterparts and vice versa. The modular structure allows
developers to extend existing integration functionality, and also
create new integration for unique business specific Drupal entities.

//"page"6"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Implementation of the Salesforce Suite requires a few more steps than


typical modules due to the nature of integration with unique custom objects
using SOAP:

! After enabling the required modules, the Web Services Description
Language (wsdl) file IS downloaded from the Salesforce.com
administration section.
!

Once the wsdl file is installed, the user can then define how the data
from Salesforce should be mapped to Drupal through object mappings.
!
!

The wsdl file is a description of the all the Salesforce Objects, the Salesforce
Object fields, the field data types and several other layers of descriptive
details necessary for implementing the web service. The wsdl file is the
primary method used by Salesforce to communicate object structures to
Drupal.
The wsdl file can be downloaded multiple times, allowing for continuous
development long after the initial implementation. Any time a modification
occurs to a Salesforce data structure, if that change is to be leveraged by
Drupal, the change must be communicated to Drupal by uploading the latest
Salesforce wsdl to Drupal.

An entity mapping is created for each object type that needs to be


communicated between the two systems, Drupal and Salesforce.
Object mappings describe how Drupal entities correspond to Salesforce
objects. The mapping also describes how the Drupal fields relate to the
Salesforce fields.

The last step it to decide and implement a method for two-way


communication.
!

Some choices are real time two-way communication, periodical


synchronization, or no synchronization.

Real time two-way communication requires further changes to the


Salesforce environment.

Not all projects require real time two-way communication between environments,
though it is typically desired as it provides a more comprehensive solution. These
additional modifications are not required for integration - or even for allowing
Drupal to update from Salesforce as interval based updates can be leveraged
instead.

//"page"7"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Updating Changes From Drupal to


Salesforce via SOAP API

1.

Existing user or node on Drupal has


unique identifier (nid or uid).
2. Drupal requests an object creation with
Salesforce via the SOAP API. The Object Field
Mapping is used to define the details of the
request, which identifies the fields to be set for
the new Salesforce object.

3. Salesforce response includes the Salesforce ID (SFID)


for the new object created. This is saved on Drupal
and is linked to the Drupal Object using the
Salesforce Object Map

//"page"8"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Manual Mapping Required


Loosely Coupled Salesforce Integration

Data objects between Drupal and Salesforce know very little about one
another aside from their unique IDs. The two IDs from Drupal (object ID and
user ID) and the single Salesforce entity ID are stored in the Drupal
database.

Mapping data structure objects and fields can be accomplished through
using the wsdl file that exposes the Salesforce architecture to Drupal. This
facilitates the means to effectively communicate field data between the two
endpoints.

Mappings are manually created via the Salesforce Suites
administrative screens.
The mappings are created per object type and that object types fields,
correlating the Drupal object and its counterpart on Salesforce at a
granular level.

//"page"9"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

WSDL Supported Object Mapping


Between Drupal & Salesforce
These mappings are required for data fields that need to be communicated
back and forth, although not all fields need to be mapped for
communication to exist. For example:

!
!

A typical mapping would be to match the fields from your Drupal Opportunity
node to a Salesforce Opportunity object.
Another example would be to map the fields from a Drupal Account Node to a
Salesforce Account object, though a more desirable implementation might be
mapping a Drupal User to a Salesforce Account object.
!

The latter allows for a Salesforce team member to receive data from existing Drupal
members through their Salesforce environment, avoiding the need to log into the
Drupal site. This type of mapping also allows for rudimentary administration of users
from the Salesforce endpoint.

//"page"10"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

The field mapping allows for proper communication between the two
endpoints, but it must be manually updated when field changes occur. This
type of manual field mapping maintenance is an important facet to
maintaining a working status between Drupal and Salesforce. It also
allows for the two systems to grow and change independently of each
other.

Drupal implements three basic operations - Create, Update and Delete between the two endpoints using the same workflow. When an operation
occurs, e.g., creating a user, Drupal makes the corresponding call to
Salesforce. Each operation has its own subtle difference:

!

Create Drupal creates the object locally, creates the corresponding object on
Salesforce, then saves the local object node and the remote Salesforce ID to the
Salesforce Suites object mapping table.
Update After updating the object locally, Drupal looks up the corresponding
Salesforce object from the object-mapping table. Using the Salesforce ID, Drupal
calls for Salesforce to update its record using the updated data from Drupal.
Delete Similar to create with the exception that Salesforce will delete its record,
and the entry from the object-mapping table is also removed.

Communication between two or more systems can create a data


management challenge.

However, given enough forethought and planning, this does not need to be
a problem. With the right strategy in place from the beginning your
development team should be able to set you up for success.

//"page"11"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

The Elegant Solution


Continuous Synchronization
For the same operations previously mentioned, two-way real time
communication from Salesforce to Drupal requires additional configuration
through the Salesforce administration tools. It is important to remember
that each object that is added in Salesforce also requires a trigger, which
must be created to connect data from Salesforce to Drupal. Therefore this
effort takes an experienced development team to properly configure each
system to notify the other of changes. But, if done properly the return
would be the greatest of the possible integration methods discussed in this
paper.

Imagine having both your Drupal and Salesforce platform speaking the
same language and communicating back and forth automatically. If your
sales staff makes an update to a user account in Salesforce it gets pushed
to Drupal and is updated with out any redundant manual data entry. If a
user makes a change to their account in Drupal or orders a new product
that data can be recorded and sent to Salesforce.

Continuous synchronization
gives your business the most
up to date customer data
and allows you to make
decisions based on

OBJECTIVE information.

//"page"12"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Continuous synchronization is by far the most complete, elegant


solution to this challenge and is typically tailored toward enterprise
level requisites.

Here is a cursory overview of a continuous synchronization workflow
followed by a diagram to further make sense of the steps taken by both
platforms to accomplish the continuous synchronization:

! Salesforce makes a request to Drupal informing it of a change to a
given Salesforce ID.
!
!
!
!

Drupal receives the change request via its web service


mechanisms and propagates the change to the Salesforce Suite
modules.
!

The request is a Salesforce Outbound Message, which is an XML formatted request


and referred to as a Notification.
A Notification is a change that has most recently occurred to Salesforce data, for
example creating an Object or updating an existing Object.
Notifications are a customizable setting through the Salesforce administrative
interface.
Each Notification is an individually created setting of a Salesforce Object type. It is
important to note that a Notification must be configured for each Salesforce Object
type that is created.

The Salesforce Suite modules use the object-mapping table and the incoming
Salesforce ID to determine the corresponding Drupal object. This process also
determines the corresponding Drupal module to complete the change request on
Drupal.

The accompanying Salesforce Suite modules complete the


change request.
!

The existence of the mapping between the Salesforce ID and the Drupal entity ID
determines if the incoming change request should be created or updated.
!

If a relationship already existed between Salesforce and Drupal on the


incoming ID, the object is updated.

If the relationship did not exist, the corresponding Drupal entity is created and
the new relationship is stored in the database.

The field mappings are used to save the incoming data from the Salesforce
Object fields to the appropriate Drupal fields.

//"page"13"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Continuous Synchronization
Two Way Communication

This flow chart shows the process that happens when


either Drupal or Salesforce data is updated or changed.

When the two platforms have a two way


communication the data is updated to either
platform automatically.

//"page"14"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Another viable solution for a two-system environment is a parent-child


relationship, where the child system collects data and passes it onto the
parent system for business operations. Salesforces leading position
among business processes usually elevates it to be the parent, making
Drupal the child.

Despite its child role in the relationship, Drupal can still be updated using
either a manually triggered or time-based operation. When synchronization
is triggered on Drupal, the existing records on the child system are iterated
through, updating each records fields with its counterparts mapped data.

Which solution is ideal in bridging the gap for your business
requirements?

Choosing the best data synchronization solution requires an objective
review of the integration project and the data requirements surrounding it.
Continuous synchronization is a superior solution to the alternatives, but it
comes with the cost of planning and the technical considerations that are
demanded by an enterprise level project. In return, the real time
communication benefits offer an experience that is desirable and
increasingly expected of online interactions.

Keep in mind that data management can be an amorphous problem, and
careful attention should be given to this issue during the planning phase of
a project. It is important to commit to one integration solution as switching
between solutions may not always be a simple change and valuable
development time can easily be lost.

To avoid costly errors and rework, consulting with experienced DrupalSalesforce integration professionals can help you successfully define and
implement a plan that seamlessly solves your business needs.

//"page"15"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Benefits
With a successful integration between Drupal and Salesforce in place the
benefits can be immediately felt by your entire staff, not just the sales
department. By connecting the two points your Salesforce data will
automatically update when new leads, prospects, or clients come to your
website and enter their data, fill out a webform, or order a new product.
This synchronization will drastically streamline your workflow by cutting out
redundant steps and unnecessary data entry.

How many times has your sales team used bad data as an excuse to why
sales arent growing?

! The phone number was wrong.
! The contact person left 2 years ago.
! I simply dont trust the data in Salesforce!

What if you could put that all behind you with the knowledge that 100% of
your Salesforce data was correct? Make your staff more effective and
efficient with a continuous synchronization between Salesforce and your
Drupal CMS.

This is true Web Experience Management and no other product on the
market can deliver this truly adaptable experience like Drupal.

//"page"16"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

Conclusion
Drupals modular design has a proven track record for third-party
integration, with Salesforce being one of the many services readily
available. As an Open Source project written in PHP, Drupal has a solid
foundation to keep up with the changing technological topography.

Third-party service modules like the Salesforce Suite are a great baseline
for most enterprise solutions. In some cases, their generic services and
basic routines fulfill all primary business needs without any customization;
however, most implementations typically require further customization
through additional modules or extensions of existing functionality, both of
which are supported and encouraged by Drupal.

With expert guidance, Drupal is a strong contender as an enterprise
integration solution with Salesforce.com (and other third party tools).

Our development team has extensive work integrating Drupal and
Salesforce, as well as over 75 other third-party platforms, and we have
the experience to optimize your website and help you get more from
your existing software.

//"page"17"

AUTOMATE SALESFORCE.COM WITH A DRUPAL INTEGRATION

its not magic,


its excellence

We build complex and elegant Open Source web solutions and we do


it right the first time so you can launch with confidence.

Our ethos is its not magic, its excellence, and our all star
developers deliver on that promise with every new project we take on.

You might also like