You need to sign in to do that
Don't have an account?
ygutierrez
Web-To-Lead form - does it need headers?
I'm trying to use an aspx page which have a HttpWebRequest to submit the form. Instead of having the user submit the form to send the information. This is because I want to send all leads collected in the website once a day reading from our database.
When I run the form, which have the action to go to salesforce applet, by typing the URL in a new browser (http://localhost/salesforce_form.aspx?sEmail=testyesi0721@testyesi.com) it works perfect (create the lead in SF), but when I run the form using (HttpWebRequest) WebRequest.Create(sCreateURL); it doesn't create the lead. This is my code in the page that I want to run once a day (I'm just testing creating one lead, then I will change it to have the request within a loop to send all leads.
string sCreateURL = "http://localhost/salesforce_form.aspx?sEmail=testyesi0721@testyesi.com";
HttpWebRequest req = (HttpWebRequest) WebRequest.Create(sCreateURL);
string sCreateURL = "http://localhost/salesforce_form.aspx?sEmail=testyesi0721@testyesi.com";
HttpWebRequest req = (HttpWebRequest) WebRequest.Create(sCreateURL);
req.ContentType = "application/x-www-form-urlencoded";
req.UserAgent = "Mozilla%2f4.0+(compatible%3b+MSIE+6.0%3b+Windows+NT+5.1%3b+SV1%3b+.NET+CLR+1.1.4322)";
HttpWebResponse res = (HttpWebResponse) req.GetResponse();
res.Close();
I will appreciate any help on this issue
Thank,
Yesenia
Thank,
Yesenia
string htmlContent = resStream.ReadToEnd();
resStream.Close();
res.Close();
Response.Write (htmlContent);
Thanks for your help
If you're doing a batch operation, why don't you just write a console app that reads your data and uses the API to create the Leads, and run it from the windows scheduler.
I sent the previous reply withouth ending my response.
Just in case the logic is this:
salesforce_form.aspx has the form using the code provided by salesforce to create the leads from the web. It's here where I include action= "...salesforce applet.."
salesforce_getleads.aspx is the page where I want to read all leads collected during the day in my website and then create a loop where I send the salesfroce_form.aspx for each lead. It's here where I have the WebRequest for salesforce_form.aspx?sEmail=xxx@xxx.com
Thanks for your attention. I'll appreciate any help on this issue
Yesenia
Thanks for your help, I did you you recommend me and it's working. But now I have a problem in the values of a picklist (with multiple values selection). As I mentioned before I'm using the Web-To-Lead code to create the leads in SF. How do I send multiple values? I'm using ";" but it doesn't work. It send the whole string "value1;value2;..." (it even cuts the text)
I hope you can help me with this.
Thanks,
Yesenia