Project:Salesforce Webform Data Integration
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I am running drupal 5.19, webform only contains last name, company and the sid. no error after submitted form,
but data are not in salesforce leads. wireshark sniffer did show conversation between my machine and salesforce.

I saw following records at my developer account of sf after each submit:

Username Login Time Source IP Login Type Status Browser Platform Application Client Version API Type API Version
[myemail] 7/2/2009 2:50:39 PM EDT [myip] Other Apex API Success Unknown Unknown N/A N/A SOAP Partner 13.0

so it is not issue of login failure.

anyone knows how to debug or where I should look at?
I appreciate your help!

Comments

#1

I can add leads with just Last Name, Company, and SID, with 5.x-1.5 on my testing box. If you have Devel installed, you can check the raw array from Salesforce if you add the following line in salesforcewebform.module, line 313, right after
$results = $client->upsert("WebformSID__c", $sObjects);
add:
dpr($results;)

And then try to add a record. An ID will be returned on success, an error message on failure.

If it does return an error message, I can help you diagnose it.

Thanks,
Bryan O'Shea
Obsidian Design

#2

Bryan,

Thanks for your message!

I have devel installed, then I added "dpr($results);" at line 313,
added a new record, but the last page is the same as before,
no ID, no error message, any clue?

update: I installed drupal6 with webform, devel and salesforcewebform,
and did the same test, the result is the same as it on drupal5.
I have already reviewed installation steps of salesforcewebform carefully to make sure
no mistake.

#3

Hello tutube,

I encountered the same issue (no ID, no error msg), that I solved by modifying the Lead custom field type 'WebformSID'.
I first created it as a number, but changing it to a text field fixed the problem.
Make sure you add a Text field, 12 caracters length, external ID and unique.

Hope it helps,
Olivier

#4

Removed

#5

I'm having the same problems as tutube.

I have added dsm($results); right after the call to upsert and it never gets that far. I put dsm('before'); before the call and dsm('after'); after the call. The "before" shows up, but not the "after" -- it simply never comes back from the upsert -- it's not even an empty $results object.

I also added debugging statements to the upsert() function. I added dsm('in'); to be sure that it was getting in, which it was. I added dsm('out'); right before the last line of the function which is the return statement: return parent::_upsert($arg); ---- can't say I understand what it means to the return a parent object. But I also did a dsm for $arg before the return and I see all the data in there which is below:

... (Object) stdClass

    *
      externalIDFieldName (Object) SoapVar
          o
            enc_type (Integer) 101
          o
            enc_value (String, 13 characters ) WebformSID__c
          o
            enc_stype (String, 6 characters ) string
          o
            enc_ns (String, 32 characters ) http://www.w3.org/2001/XMLSchema
    *
      sObjects (Array, 1 element)
          o
            0 (Object) SObject
                +
                  type (String, 4 characters ) Lead
                +
                  fields (Array, 25 elements)
                      #
                        OWNERID (NULL)
                      #
                        WebformSID__c (String, 12 characters ) 987-fe04fd4c
                      #
                        Title (String, 4 characters ) asdf
                      #
                        FirstName (String, 4 characters ) asdf
                      #
                        LastName (String, 4 characters ) sadf
                      #
                        Company (String, 4 characters ) asdf
                      #
                        Email (String, 20 characters ) email@email.com
                      #
                        Phone (String, 4 characters ) asdf
                      #
                        City (String, 4 characters ) asdf
                      #
                        State (String, 4 characters ) sadf
                      #
                        00N300000033euY (String, 4 characters ) adsf
                      #
                        00N300000041Q2o (String, 23 characters ) Middle school students;
                      #
                        00N300000041Q2y (String, 17 characters ) Academic success;
                      #
                        00N30000003oNFg (String, 4 characters ) asdf
                      #
                        00N30000001mIda (String, 6 characters ) 51-100
                      #
                        00N30000003oNHC (String, 2 characters ) No
                      #
                        00N300000041Q3I (String, 2 characters ) No
                      #
                        00N300000041Q3S (String, 3 characters ) Yes
                      #
                        00N300000041Q3T (String, 18 characters ) Less than one year
                      #
                        00N300000041Q3c (String, 12 characters ) Many to many
                      #
                        00N300000041Q3m (String, 21 characters ) More than once a week
                      #
                        00N300000041Q3w (String, 12 characters ) Once a month
                      #
                        00N300000041Q41 (String, 3 characters ) Yes
                      #
                        00N300000041Q3x (String, 3 characters ) Yes
                      #
                        00N30000001mIe4 (String, 7 characters ) asdfsfd
                +
                  any (String, 908 characters ) <OWNERID></OWNERID><WebformSID__c>987-fe04fd4c<...
                      #
                        <OWNERID></OWNERID><WebformSID__c>987-fe04fd4c</WebformSID__c><Title>asdf</Title><FirstName>asdf</FirstName><LastName>sadf</LastName><Company>asdf</Company><Email>stephen@capellic.com</Email><Phone>asdf</Phone><City>asdf</City><State>sadf</State><00N300000033euY>adsf</00N300000033euY><00N300000041Q2o>Middle school students;</00N300000041Q2o><00N300000041Q2y>Academic success;</00N300000041Q2y><00N30000003oNFg>asdf</00N30000003oNFg><00N30000001mIda>51-100</00N30000001mIda><00N30000003oNHC>No</00N30000003oNHC><00N300000041Q3I>No</00N300000041Q3I><00N300000041Q3S>Yes</00N300000041Q3S><00N300000041Q3T>Less than one year</00N300000041Q3T><00N300000041Q3c>Many to many</00N300000041Q3c><00N300000041Q3m>More than once a week</00N300000041Q3m><00N300000041Q3w>Once a month</00N300000041Q3w><00N300000041Q41>Yes</00N300000041Q41><00N300000041Q3x>Yes</00N300000041Q3x><00N30000001mIe4>asdfsfd</00N30000001mIe4>

#6

I've since discovered that the field names were wrong. You can't use the same field name/id that is provided when you generate a web-to-lead form from SalesForce. You need to use the API name which will have the following format:

Field_Label__c

You simply append "__c" to the end of the Field Name which is "Field_Label" in my example above.

Being new to Salesforce, it took me a long time to figure this out. All my frustration could have been avoided with some exception handling. But, really, the best path forward is to implement the feature suggested in this patch which is to get the custom fields from Salesforce to avoid having to enter them manually.

http://drupal.org/node/760770

#7

Version:5.x-1.5» 6.x-1.x-dev
Category:bug report» feature request

#8

Attached is a patch that will display error messages on the success page of the form. Yes, it's odd that there would be a fatal error on the success page, but this is more for implementers to at least have some sort of error message. This code be improved to also write to watchdog.

The patch file looks like a log has changed, but not really. Most of the changed lines occur because the existing code is no wrapped in an "if" clause so that it only runs on success.

AttachmentSize
salesforcewebform-ADDING-ERROR-HANDLING.patch 4.78 KB
nobody click here