Firstly, thankyou for this module. This is exactly what I looking for. Unfortunately for me I seem to have some issues getting it working.

Firstly, there is no mention on your project page that 'multicrud' is a requirement in order to install. Not sure why this should be but there you are.

Secondly, my main issue is that I am having an issue trying to post data to sales force vi the web-to-form method. The form does appear to be posted, but unfortunately all the field contents or input does not seem to be populating the relevant fields in Salesforce.

Under 'admin/settings/sfweb2lead' I have managed to enter in my 'Salesforce OID' as well as the 'Salesforce URL' (although I think this is already correctly populated).

I have also managed to map all my 'Webform Field Key' to 'Salesforce Web-to-Lead Form Field' 's even though I have taken care to give them the same name anyway. Therefore I do not know if this is necessary or not.

Then, after completing the form, I hit submit and I am then shown the Thank you, your submission has been received' confirmation page and I also have a link below that reads 'Go back to the form'.

Finally when I check the submitted lead when logged into salesforce, it seems to display only that the form has been submitted and the field 'Lead Source' is populated with the name of my newly created node!?

Would appreciate any help with this as would love to incorporate Web-to-Lead using Webforms input validation without the need to upgrade our salesforce edition/license in order to access the salesforce API.

Comments

chriscalip’s picture

Your welcome! The company I work for Straight North and myself are happy to help. I am sorry that there is no documentation yet; its on the way. In the meantime Can you post a patch? :) a README.txt and an INSTALL.txt would be great.

I'll try to document the concerns you have listed and also answer it right now.

a.) The multicrud 6.x-1.0-alpha1 module is required for this module. Please make sure you have this version of the module and not the 6.x-2.0-unstable1 version of the module < I have not tested it yet> The multicrud module is required because of the configuration settings page; it lets the settings page accept the mapping webform field_key -> salesforce web-to-lead form field on an multi-value basis.

Maybe we should have an option to turn on the mapping feature and non-mapping feature? The way the code flows.. it should be easy to have an non-mapping feature .. you pretty much have to make sure your keys are the same with salesforce. What do you think?

b.) Yeah For usability purposes I have a default "Salesforce URL" the correct one.

c.) I felt it was necessary to have a mapping feature instead of just having all users of the module have an implicit requirement of making the webform field key and salesforce field key having the same name. I am open to suggestion to make this more user friendly.

d) Yeah the lead source is the node title or the page title
of the webform. Do you think it would be wise to have each webform be able to accept a lead-source code? I can quickly add that feature. What do you think?

I welcome any suggestions to make this module better and make our lives easier on implementing this feature.

2dareis2do’s picture

Yes, I like your carousel on your website. Simple but effective and the way the background keeps consistent. very nice.

Ok, I would be happy to try and submit a patch, providing I can actually get it working correctly. I have reinstalled 'multicrud' v6.x-1.0-alpha1 as described but I am experiencing the same problem. Mainly the fields do not seem to be being transferred to salesforce apart from the 'Lead source' which is the same as the node title.

I must admit I am fairly new to salesforce so perhaps I am doing something wrong on that side, but essentially i am using the same form generated from salesforce (actually I just submitted it as I had implemented it in a node and receive a message about my submittal being queued - as opposed to being redirected to a thankyou page - that is odd!?)

With regards the mapping tool, which fields are you mapping. There are some hidden fields too. What are you doing with these.

i.e. oid - does this need to be added or is this already taken care off in your config.
retURL - is this tsill relevant - presumably this is handled by webform now. Do we still have to enter and map it?

Also, what happens if we don't map fields, e.g where the name of the field is the same. Is this still necessary.

Apologies for the barrage of questions but would love to get this working.

2dareis2do’s picture

Oh yeah, I am not sure what the benefits would be of having each web form be able to accept a lead-source code?

chriscalip’s picture

Maybe we could help each other out? you getting your site up and running with salesforce and webform, me having a better module.
We could do this more quickly if we can have a skype call or something? instead of the forums; its faster. i'll send you my contact info by drupal's contact form on your user profile

chriscalip’s picture

#3 --

Well I got a site with multiple webform's and lead campaigns.

chriscalip’s picture

With regards the mapping tool, which fields are you mapping. There are some hidden fields too. What are you doing with these.
** Mapping tool was planned for webform field key to salesforce field key. hidden fields?? can you elaborate better

i.e. oid - does this need to be added or is this already taken care off in your config.
**Yeah if you added oid in the config settings page -- this is automatically added in the curl post.

retURL - is this tsill relevant - presumably this is handled by webform now. Do we still have to enter and map it?
**yeah the Salesforce retURL is not needed since webform is handling this.. no need to enter and map it.

Also, what happens if we don't map fields, e.g where the name of the field is the same. Is this still necessary.
**Currently there might be some problems if we dont map the fields. i hear you where if you just manually set the name of the field to be the same... it should be right. I can make it this way.

In the meantime, let me see if I get this right.. is your problem you have :

Your getting your lead in your salesforce, the lead source is the title of the webform node. But there is no other field that got filled up in your salesforce? is this correct? did you map the webform field key and salesforce field key?

2dareis2do’s picture

Thx for your quick response.

Ok I have emailed you my contact details. I can't seem to access my email as my registrar seem to be having an issue renewing my domain name. Hopefully that will be resolved soon.

1. I have removed the hidden fields because as you say they are handled by your module. I guess the main ones I am using are oid and retURL.

2. See point 1.

3. I have mapped all the fields. This matches the number of fields that I have crested using webform. They are in a different order but I am not sure that this matters. As far as I know all the fields I have created have the same name. i.e yes I have mapped each of the webform field key to the salesforce field key

i.e. first_name mapped to first_name, last_name mapped to last_name, etc for each of my 15 or so fields.

One difference the fields organised by fieldset. Not sure if this makes a difference?

chriscalip’s picture

That was the clue I needed! Those Fieldset's really does make a difference. It messes up the mapping and the module does not currently have the logic to handle fieldsets.I can fix it for the later versions.

chriscalip’s picture

New release has the fix.
http://drupal.org/node/1095096

thanks for making the module better.

leovw’s picture

This module is just what I needed so thank you very much - I was myself experiencing problems with the fieldsets so am looking forward to trying out the update...

A couple of questions/feature requests

The Page Break feature doesn't seem to work with it - Don't suppose you are able to make this work too?

Also I used multicrud 6.x-2.0-unstable1 (it seems to work pretty well by the way) I was wondering whether you knew if it is OK just to swap this for the version 1?

One other things which I will ask on the off chance you know of an answer: I need to have an address and a delivery address which can be one and the same... DO you know if there is a way of populating the delivery address if it is the same as the billing address(whilst keep it hidden)?

Thanks again

chriscalip’s picture

Leovw,

Also I used multicrud 6.x-2.0-unstable1 (it seems to work pretty well by the way) I was wondering whether you knew if it is OK just to swap this for the version 1?

** The unstable tag scared me away so i did not even test it. But if it works for you after testing... why change it? The module requires just the basic and core functionality of multicrud .. maybe the api didn't change.

The Page Break feature doesn't seem to work with it - Don't suppose you are able to make this work too?
** what is this? I am not familiar with it... you mean webform or salesforce?

One other things which I will ask on the off chance you know of an answer: I need to have an address and a delivery address which can be one and the same... DO you know if there is a way of populating the delivery address if it is the same as the billing address(whilst keep it hidden)?
** hmm.. tricky.

chriscalip’s picture

Page Break feature of webform. hmm i have not tested it yet.. will double check.

chriscalip’s picture

Yikes! it totally broke the module :( I'll fix this problem.

chriscalip’s picture

Webform Page Break Compliant! version of this module now live @ http://drupal.org/node/1095332

leovw’s picture

Thank you so much that is incredibly good of you (and mightily speedy too!)

Looking forward to giving it a go...

chriscalip’s picture

Your welcome! and thanks for making this module better!

2dareis2do’s picture

I have now had a chance to test this extensively and fields based in fieldsets now definitely work. Thankyou.

One thing worth noting is that webform seems to convert everything to lowercase when entering fields names so care needs to be shown at this level and if need be your mapping tool makes the job of correcting these even easier.

Lastly, I am not sure if it is worth creating a new topic but one minor detail is how you handle multiple item fields, i.e where the user can select multiple items for the same field, i.e. checkboxes etc. I have tested this and it only seems to pass single items to salesforce. Does your module have support for multiple items?

chriscalip’s picture

One thing worth noting is that webform seems to convert everything to lowercase...
** I might be wrong about this, but its probably a non-issue because the webform field_key is the that's already converted to lower case and space to underscore, and furthermore the webform field_key is the one we are trying to map with the salesforce field key.. or maybe i am reading it wrong.. ok I read it wrong. yeah its a nice feature to have.. i welcome any patch for this (for now.. i don't think it's as important).

Does your module have support for multiple items?
** Nope, it does not. Does Salesforce support multiple items? I definitely think this is a worthwhile feature to be added in this module if sf support this feature. i think this is important once its confirmed ill make a new release; if not maybe we can just make a comma separated string to pass and still make a new release at the end of the day.

2dareis2do’s picture

Fantastic.

FYI a multiple item field looks like this (taken from web-to-lead form)

Regions of Interest:<select  id="00N20000002M5fo" multiple="multiple" name="00N20000002M5fo" title="Regions of Interest"><option value="All">All</option>
<option value="Asia">Asia</option>
<option value="North America">North America</option>
<option value="Europe">Europe</option>
<option value="Latin America">Latin America</option>
<option value="Rest of world">Rest of world</option>
</select><br>

Just looking into how to make a patch with drupal.

2dareis2do’s picture

Ok tried to submit a patch but received fatal: ambiguous argument 'origin/6.x-1.2': unknown revision or path not in the working tree.

so I thought I would post my details here for a readme file:


$Id: README.txt,v 1.2 2011/03/18 14:58:34 2dareis2do$

Description:
------------
This module extends the webform module to easily allow submitting a SalesForce web-to-lead form. This is important for Salesforce users who are not currently subscribed to either their Enterprise, Developer or Unlimited editions.

Dependencies:
------------
Multicrud v1.0 +
Webform v3.x +

Installation:
------------
This module is installed like any other drupal module. Firstly make sure your dependenencies are installed correctly. This modules currently works and has been tested with v6.x-1.0-alpha1 and Webform v3.x.

Configuration:
------------
At first you will need to login to your SalesForce Account and create a web-to-lead form. This is accessible from Setup>Customize>Leads>Web-to-Lead.

You should now be on the Web-to-Lead Setup page. Simply click on the 'Create web-to-lead button' and select the fields that you would like to have available on your website. Once you have finished hit the 'Generate' button and you should be taken to a page where you can copy the form that salesforce has generated to your webpage.

Now you are ready to create your form using Webform as you would normally. Go ahead and create all your fields and then when you are finished you should be taken to the edit tab where you will see a fieldset that gives you the option to select 'Submit to Salesforce'. Make sure you select that and then save your form.

Lastly you will need to configure the module to submit to salesforce using your account settings that can be found in the SalesForce generated web-to-lead form. A link to this can be found under Administration>Site Configuration or alternately you can access it directly using the path 'admin/settings/sfweb2lead'.

Most important is to enter your Salesforce OID. This can be found in your web-to-lead form you generated earlier. You can also enter your 'Salesforce URL' (if it is different from the default) and finally you need to map your Webform Field Key name to your Salesforce Web-to-Lead Form Field for all the fields that you want to be entered into salesforce, even if you have used the same names.

Thats it. Once you are done, go ahead and submit your form and see if it populates salesforce.

One tip is to enable the salesforce debugEmail field in your webform to allow you to be emailed once the data has been submitted.

Also be careful with mapping the fields as webform tend to change your field name to lower case that can result in certain fields not being passed to Salesforce correctly.
chriscalip’s picture

thanks 2dareis2do,

I am currently working on the module and plan to add the leadsource feature on the node and the multi-value feature on the next version.

Lead Source -- will not be the node title anymore but will be whatever you put as the leadsource. Quick question if the leadsource is not provided in the node form should we default the lead source as the node title? .. thats what my plan.. i am open to suggestions.

kind regards,
Chris Calip

chriscalip’s picture

2dareis2do,

Thanks! with your help we got a better module : http://drupal.org/node/1096796

Cheers,
Chris Calip

http://drupalcode.org/project/sfweb2lead_webform.git/commit/a882c8f

chriscalip’s picture

Version: 6.x-1.0 » 6.x-1.1

a.) Any issues with the multi-value feature should be discussed here:

http://drupal.org/node/1096774

b.) Any issues with the lead source feature should be discussed here:

http://drupal.org/node/1096664

2dareis2do’s picture

Glad to be of help although my input was minimal really. It people like you that make Drupal such a great framework/cms. Many thanks for a great module.

chriscalip’s picture

Status: Active » Fixed

hey we are all in this together.

Status: Fixed » Closed (fixed)

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

davemaxg’s picture

Version: 6.x-1.1 » 6.x-1.4
Category: support » task
Status: Closed (fixed) » Needs work

I'm using version 6.x-1.4 and I've set up a web form that only accepts an email address then after a page break asks the user for their first and last name, company and a few other fields. The problem is that the form gets submitted to sf with only the email address.

I've put together a fix that addresses this issue, however I'm not fully versed in git and how to submit patches properly so I'll leave the fix here for anyone that may need it. I've tested this successfully with a webform that has a single page break and one that has no page breaks. It may not work if you have a form with 2 or more page breaks. The fix turns the webform_submission_insert hook into a function that is called depending on whether the _update or _insert hook should trigger the call to salesforce.

This line:

function sfweb2lead_webform_webform_submission_insert($node, $submission) {

should be replaced with the code below.

function sfweb2lead_webform_webform_submission_update($node, $submission) {
	sfweb2lead_webform_submit($node, $submission);
}
function sfweb2lead_webform_webform_submission_insert($node, $submission) {
	if($submission->is_draft==0){
		sfweb2lead_webform_submit($node, $submission); 
	}
}
function sfweb2lead_webform_submit($node, $submission) {

I think this fix should probably be added into the project at some point as is or perhaps reworked to handle any number of page breaks...

chriscalip’s picture

Assigned: Unassigned » chriscalip
chriscalip’s picture

Status: Needs work » Fixed

Hi Dave,

Thank you for the heads up, committed @link
http://drupalcode.org/project/sfweb2lead_webform.git/commit/6fe1d63

It's not part of the release candidates yet, but it should be available under the dev release

kind regards,
Chris Calip

chriscalip’s picture

Status: Fixed » Closed (fixed)

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