Drupal Integration with Salesforce.com

Tue, Aug 4, 2009 by Steve

Currently, we are working on a Drupal 6 project that requires integration with Salesforce.com. We use the Salesforce module for Drupal 6 (http://drupal.org/project/salesforce). We also use the webform module to create the desired form. The data will be sent to Salesforce.com after a user fills out and submits the form.

To achieve this, we need to map the webform fields to Salesforce lead fields. We searched and found the Salesforce Webform Integration module (http://drupal.org/project/sf_webform). We realized later that this module didn't really work with the salesforce-6.x-2.x-dev module. The Salesforce Webform Integration module is using $map['index'] and $map['webform_nid'] to refer to fieldmap index ('fieldmap' field in table 'salesforce_field_map') and webform node id ('nid' field in table 'salesforce_webform'). However, you can't find $map['index'] and $map['webform_nid'] in the 'map' variable in salesforce-6.x-2.x-dev. Instead, salesforce-6.x-2.x-dev is using $map['fieldmap'] to refer to the fieldmap index, and it does not have the webform node id info in the 'map' variable.

A quick and temporary fix to this issue, if you want to make use of the existing good work without spending much time writing your own module, would be simply to replace all $map['index'] with $map['fieldmap'] in the file sf_webform.module and assign a value to $map['webform_nid'] via a custom function that retrieves webform node id based on fieldmap index.

You can also implement your own hook_fieldmap_objects() to pull the desired fields for field mapping (see examples in Salesforce Node or Salesforce User module that are part of the Salesforce module). We hope this useful module will be updated soon and made compatible with salesforce-6.x-2.x-dev.

By the way, for those who are new to Salesforce, you need to sign up for a Salesforce developer account (http://developer.force.com/) to perform testing and other related jobs. The settings of Salesforce module require username, password and security token from your Salesforce account. To get your Salesforce security token simply:

1) Log into your Salesforce account
2) Go to Setup
3) Go to Personal Setup
4) Look under My Personal Information
5) Select Reset My Security Token

Maj posted on August 28, 2009 2:34 pm

Working on the same issue (seem to be a lot of us!). Thanks for sharing your solution. This was also the first I'd seen about the Visitor Path module, which looks promising.

I'd like to second the question about Salesforce professional vs enterprise -- does any one know which is required for either the salesforce module or webform one?

thanks!

steve posted on August 11, 2009 10:02 pm

Thank you for your update and for this useful module. It's working fine so far except for one thing: the message 'This webform is associated with fieldmap xx' on the 'node/xx/salesforce' page does not seem to always output the correct fieldmap index when multiple fieldmaps exist.

openbook posted on August 11, 2009 10:25 am

Ive just updated the Salesforce Webform Integration module (http://drupal.org/project/sf_webform) so that its compatible with the latest version of the Salesforce API (salesforce-6.x-2.x-dev). Updating your copy of the module should solve the problem.

Thorwald Westmaas posted on August 5, 2009 10:03 pm

Does this linking work with Sales Force Professional or do you need the Enterprise edition with API ?

http://www.salesforce.com/crm/editions-pricing.jsp

Benjamin Melançon posted on August 5, 2009 1:04 am

Another option for webform->salesforce is Saleseforce Webform module. Agaric did a little work around that with the visitorpath module.

We hope to see convergence among these modules, but after seeing our Drupal 5 version of salesforce module (similar in spirit to the modularization of the 6.x-2.x branch with webform integration) instead be joined by two more different approaches, we picked the lightest weight and most to-the-point solution for Drupal 6.

ben, agaric

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <h2>
  • Lines and paragraphs break automatically.

More information about formatting options