Project:Salesforce Webform Data Integration
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:obsidiandesign
Status:closed (fixed)

Issue Summary

This looks great! But I need to extend it to a custom object of mine. How would I begin to do this?

Comments

#1

Assigned to:itdcole» Anonymous

#2

Status:active» fixed

*Needs better documentation*

The path for the soapclient needs to be the full path.
ex. "/var/www/html/{website folder}/modules/salesforcewebform/includes"
Not. "/{website folder}/modules/salesforcewebform/includes

To change it to a custom object find the code that says (around Line 277 in salesforcewebform.module):

  $sObject = new sObject();
  $sObject->type = 'Lead'; // Salesforce Table or object that you will perform the upsert on
  $sObject->fields = $all_fields;
  array_push($sObjects, $sObject);

And change "Lead" to the qualified API Name.
ex. "custom_object_name__c"

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

Status:closed (fixed)» active

How hard would it be to add this as a field in the webform to determine which object type the push went to? You mentioned in your "ex." that you could add "custom_object_name__c" to replace 'Lead' in the code. Would that fix this? It would be awesome if this feature could be added so that each webform could potentially push to different object types (i.e. Contacts, etc.).

#5

Category:support request» feature request
Assigned to:Anonymous» obsidiandesign
Status:active» needs work

First test at including the ability to link to Accounts, Contacts, or Leads through the same form. Please make sure to run update.php if you try the patch, as the object type is stored into the database. THIS IS NOT PRODUCTION READY, so only use on test/demo systems. I would like some eyes on the patch & interface to see if it will meet peoples needs.

There are also some minor documentation & code style changes I noticed & an attempt to catch error messages & set them through drupal_set_message. The bulk of the patch, however, is the changes for custom objects.

Bryan O'Shea
Obsidian Design

AttachmentSize
salesforcewebform.538468.patch 7.87 KB

#6

Just to keep from killing our live site I tested this on another Drupal install on the same server and I am getting the following error:

warning: Missing argument 3 for salesforcewebform_process(), called in /www/sites/all/modules/webform/webform.module(1759) : eval()'d code on line 3 and defined in /www/sites/all/modules/salesforcewebform/salesforcewebform.module on line 222.

(This one is duplicated about 20 times) warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /www/sites/all/modules/salesforcewebform/salesforcewebform.module on line 260.

Required fields are missing: [LastName]

Thank you, your submission has been received.

One thing that we're a little nervous about is that we have a Private Data model on our SF instance. We also have Person Accounts enabled... if none of that makes sense then maybe we need to talk. I'm hoping that those things don't cause any problems, but it's possible. What we may need to do is re-activate your account on our SF Instance so you can do your tests there. Not sure what else to do here. We really need to get this done asap. Get in touch with me if this is going to be more time that we can compensate you for.

Thanks,
Andrew

#7

Here's some API documentation about Person Accounts: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_guide...

Also might be helpful for Person Account stuff: http://community.salesforce.com/sforce/board/message?board.id=apex&messa...

#8

I have re activated your account on our instance. Let me know if you have any problems getting in. Contact me directly.

#9

Version 2 of the patch for testing; accounts, contacts, and leads work. Better handling of errors using drupal_set_message for better debugging.

AttachmentSize
salesforcewebform.538468v2.patch 8.5 KB

#10

Also, for anyone else testing - please note the important change in INSTALL.txt - when adding the code to the additional processing box, there are now three arguments to the function.

#11

Just an update. The above patch adds the ability to push to Accounts, Contacts and Leads using this module. We've tested the above patch and things seem to be working properly now with the ability to debug. Last step is to organize the fields in the field mapping dropdown to make it easier to map your fields and know what's required when you're using different object types. Update coming soon!

#12

Status:needs work» needs review

After a series of patch changes and tests, I'm happy to be able to share a version 9 of the patch referenced in #9. It handles Accounts, Leads, Contacts, and Account+Contact combinations. Some documentation needs to be updated, but the functionality is there. Anyone that can test and review would be a huge help in pushing this forward.

AttachmentSize
salesforcewebform.538468v9.patch 17.62 KB

#13

Status:needs review» fixed

Committed to 6.x-dev.

#14

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here