• diegarte
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 16
    Replies
Hi,
 
I'm just starting with Apex, and I'm having problems with my first example:
 
I have the following code:
 
global class WSPage
{
    WebService static String getDefault(String Text)
    {
        return 'My Company ' + Text;
    }
}
 
Then, I try to use this code in a SControl:
 
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript" src="/soap/ajax/10.0/connection.js"></script>
<script type="text/javascript" src="/soap/ajax/10.0/apex.js"></script>
<script>
function demo()
{
    var strResult = sforce.apex.execute('WSPage', 'getDefault', {Text:'Testing...'});
    document.getElementById('Header').innerHTML = strResult;
}
</script>
</head>
<body onload=demo()>
<div id='Header'>
</div>
</body>
</html>
 
I'm getting a JavaScript error on my tab.  Does anybody know what the problem could be?
 
Thanks
Is the sObject [Organization] common to all Salesforce accounts?
 
I have a customer that doesn't have this sObject in his Salesforce account, how can I retrieve the account information if the [Organization] sObject doesn't exist?
 
Thanks
I have a forum registration form on my website and would like to pass info to saleforce in the form of a lead. Ideally I would just use the web-to-lead functionality that comes with saleforce (in the form of an html form that gets sent straight to saleforce). The only thing is that I need to be able to intercept the data with php so that I can save it to my local database before passing it on to salesforce. Will I have to use the saleforce api to do this, or is there a way in php to process the data and then post it to saleforce from within the code, e.g. using header(Location: salesforcepage.html) with post option. Don't think you can do this but would love to here if there's a way.
 
Any help greatly appreciated.
 
p.s. would love to do this without the api as my client only has professional edition, and it would be a big expense to upgrade to enterprise for one form.
Hi,
 
I'm just starting with Apex, and I'm having problems with my first example:
 
I have the following code:
 
global class WSPage
{
    WebService static String getDefault(String Text)
    {
        return 'My Company ' + Text;
    }
}
 
Then, I try to use this code in a SControl:
 
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript" src="/soap/ajax/10.0/connection.js"></script>
<script type="text/javascript" src="/soap/ajax/10.0/apex.js"></script>
<script>
function demo()
{
    var strResult = sforce.apex.execute('WSPage', 'getDefault', {Text:'Testing...'});
    document.getElementById('Header').innerHTML = strResult;
}
</script>
</head>
<body onload=demo()>
<div id='Header'>
</div>
</body>
</html>
 
I'm getting a JavaScript error on my tab.  Does anybody know what the problem could be?
 
Thanks
Is the sObject [Organization] common to all Salesforce accounts?
 
I have a customer that doesn't have this sObject in his Salesforce account, how can I retrieve the account information if the [Organization] sObject doesn't exist?
 
Thanks
Has anyone successfully figured out how to require and notify the user completing the web 2 lead form that they haven't field out required fields? Or has anyone written a code that will first check to see if the fields are filled out and then once the data is validated then send (post) the data to the salesforce servlet?
I found a sample form i can use to make my web 2 lead forms required and have the message post back to form saying the required info hasn't been submitted, but does anyone know how to then make it post to SF?
 
I guess what im looking for is someone that has done this, and then wouldn't mind sharing the code with me so i can get it up and running for my org(a template of code i could modify for my org) . Any information would be greatly appreciated.
 
Thanks,
JMcLeod @ FEWA
Hopefully I'm posting this message in the right place.
 
Configuring web2lead for various forms for our website I can see that simple local test code can successfully post leads into salesforce.
 
This seems to be an almighty 'hole' which makes it very easy for someone to write something nasty to fill our system with rubbish, as a simple 'view source' in a browser containing one of our web2lead forms would give them everything they need....
 
Is there a way to configure salesforce's web2lead servlet to only accept leads that come from a specific domain(s) or specific urls to stop this potential nightmare ???
 
Thanks
  • July 20, 2007
  • Like
  • 0
Hello -
 I'm creating a web-to-lead form that asks the user if they want to receive email updates on webinars, live events, and software. This field is called "Marketing Updates" in Salesforce, and is a picklist. When I generate the code for the web-to-lead form, Salesforce gives me code for a picklist where the user can use the control key to select multiple options. However, I want to make it a little more user-friendly, and have the user select from checkboxes instead of a picklist. I know the code for checkboxes, but I can't get the data to pass through to Salesforce when I used them instead of the picklist code generated by Salesforce.
 
My code looks like this right now:
 
<td>Yes, please send me email updates on the following:
    <select  id="00X0000000XXXXX" multiple="multiple" name="00X0000000XXXXX" title="Mktg Updates:">
<option value="All">All updates</option>
<option value="Webinars">Webinars</option>
<option value="Live Events">Live Events</option>
<option value="Software">Software</option>
</select><br>
I posed the following question awhile back on thread but I don't recall seeing a response.

One problem with this is that Web2Lead only inserts new records and only for Leads. So, in the first case, you'll get duplicate Leads everytime a person submits a form. Second, I don't see functionality for updating or inserting a Contact record.

So my question for SF would be: is it advisable to use the AppExchange API to do insert/updates to Lead and Contact objects everytime a web form on a web site form is completed. This would require a separate login/merge/logout API transaction for every form which might number in the 100s or 1000s per day. Or is it recommended that the best way is do synchronization of SF with web form-collected data on a scheduled basis (30 mins or hourly, etc.) and how tight a frequency is acceptable.

If someone wants to allow Leads or Contacts to change some of their fields in a self-service way, what's the best practice?

Thx for any guidance.


Does anyone know anything about the forthcoming integration between Joomla and SalesForce being designed by Picnet?
 
I have tried to contact them with regards to the tool, but have heard nothing yet.
 
 
Regards,
Warren
I've been searching this for a long time, and I want to be able to send the web-to-lead form using PHP only.

Other people have been trying this, and I've been reading through all the comments, but still haven't been able to figure it out. Currently i'm still trying the fsockopen method. Salesforce said they would get back to me on it.... but they haven't. Anyway this is the script:

function sendToHost($host,$method,$path,$data,$useragent=0)
{
    // Supply a default method of GET if the one passed was empty
    if (empty($method)) {
        $method = 'GET';
    }
    $method = strtoupper($method);
    $fp = fsockopen($host, 80);
    if ($method == 'GET') {
        $path .= '?' . $data;
    }
    fputs($fp, "$method $path HTTP/1.1\r\n");
    fputs($fp, "Host: $host\r\n");
    fputs($fp,"Content-type: text/html; charset=UTF-8\r\n");
    fputs($fp, "Content-length: " . strlen($data) . "\r\n");
    if ($useragent) {
        fputs($fp, "User-Agent: MSIE\r\n");
    }
    fputs($fp, "Connection: close\r\n\r\n");
    if ($method == 'POST') {
        fputs($fp, $data);
    }

    while (!feof($fp)) {
        $buf .= fgets($fp,128);
    }
    fclose($fp);
    return $buf;
}

I've tried using it by sending arrays and strings in different formats, such as:

$info = 'oid=\"XXXXXXXXXXX\"' . '&';
$info .= 'retURL=\"XXXXXXXXXXXXXXX\"' . '&';
$info .= 'last_name=\"Yung\"' . '&';


w/o the escapes and also:

   'oid'         => 'oid=XXXXXXXXXXX',
   'retURL'      => 'retURL=XXXXXXXXXXXXXXX',
   'last_name'   => 'Yung',


etc.

I don't want to validate/submit forms with Javascript, and my other idea is having the user confirm the details and submit to salesforce using hidden fields (but spammers can thus clone the page and spam me) while keeping the data in sessions (haven't tested this yet). Anyhelp would REALLY be appreciated, thanks!

I'm building a website for a small company that uses Salesforce and they would like to include a "Contact Us" form on their site that submits the user input to Salesforce.

Is this possible?

If so, is there any existing documentation on how to do this?

I searched the Salesforce "Help" section but only found a few brief references to "Web to X" and "Web to Lead" forms...nothing very instructional.

Thanks in advance for your help!

BC

Hi,

I am developping a contact form and I have to make a double post (in php), one on my website to save data in the database and another one on salesforce website.

For this task I am using Curl, it nearly works but I am getting problems for multiple select.

Here is my php code :

*****
$information_requested = $_POST["information_requested"];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.salesforce.com/servlet/servlet.WebToLead?encoding=ISO-8859-1" );
curl_setopt($ch, CURLOPT_POST, 1 );

$postContent .= "oid=00D300000000TGF&";
$postContent .= "00N30000000wTNa=$informationsRequested";
   
       
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postContent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);

curl_close($ch);
*****

Here is my html code :

*****
<input type="checkbox" name="information_requested[]" value="Product1">
<input type="checkbox" name="information_requested[]" value="Product2">
<input type="checkbox" name="information_requested[]" value="Product3">
*****

In my form, informations requested are an array of checkbox.
But salesforces need a <select multiple="multiple"><option value="product1"></option></select>. I don't know if this is the problem, but maybe I don't *construct* the query in the right way.

Do you have an idea ?

Thanks a lot fro your help.

Thierry Bucco

We've started to get spam leads from our web-to-lead capability added to our corporate web site. I suspect our 'contact us' web form has been scraped and is now falsely being posted with bogus information. I may need to disabled this capability for the time being to get this siutation under control but what safe guards can Salesforce offer for this issue? It seems a form of CAPTCHA (completely automated public Turing test to tell computers and humans apart) would be the best solution. Anything to can offer? Please help. Regards, -- Mark
Hi,
 
Trying something that sounds simple but has been a headache so far... be gentle, I'm new at this.
 
All we want is a small form that sends info as a lead to salesforce - this form has a hidden Campaign_ID field.
 
First of all, when you generate the web-to-lead code it gives you the Campaign_ID and not the Campaign field as the one you should be sending to salesforce. We found out from salesforce that you actually have to use the "name" and not the "ID".
 
Everything works fine except for the auto-response rule that looks for the Campaign field to then send out an email with an attachment. We've tried "Campaign_ID", "Campaign" (name), with parenthesis, without parenthesis, and many other options - it just doesn't want to work.
 
Any suggestions? Anybody out there been able to do this? We've called salesforce and they've "escalated" the issue... just trying to get a faster answer to this...
 
Any help would be appreciated.
 
Thanks,
 
rblino
  • March 08, 2006
  • Like
  • 0

I'm trying to get the web 2 leads working and the leads are never showing up in salesforce. Also, instead of returning the user to the page that I specified, it returns the user to the same page that the form was on. I am relatively certain that the form is being submitted to salesforce, but I'm not sure what the problem is.

My form looks like this (might be hard to read). You'll notice the submit button does a little bit of 'magic' to get the form to submit to the correct page (darn ASP.NET).

  <form name="Form" method="post" action="/Contact/tabid/58/Default.aspx" id="Form" enctype="multipart/form-data" style="height:100%;">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />

 <span id="dnn_ctr470_HtmlModule_HtmlHolder" class="Normal"><INPUT type=hidden value=00D300000000cPN name=oid> <INPUT type=hidden value=http://www.3pointoh.com name=retURL> Salutation: <SELECT id=salutation name=salutation><OPTION value="" selected>--None--<OPTION value=Mr.>Mr.</OPTION> <OPTION value=Ms.>Ms.</OPTION> <OPTION value=Mrs.>Mrs.</OPTION> <OPTION value=Dr.>Dr.</OPTION> <OPTION value=Prof.>Prof.</OPTION></SELECT><BR>First Name: <INPUT id=first_name maxLength=40 name=first_name><BR>Last Name: <INPUT id=last_name maxLength=40 name=last_name><BR>Title: <INPUT id=title maxLength=80 name=title><BR>Company: <INPUT id=company maxLength=80 name=company><BR>Website: <INPUT id=URL maxLength=80 name=URL><BR>Email: <INPUT id=email maxLength=80 name=email><BR>Phone: <INPUT id=phone maxLength=40 name=phone><BR>Fax: <INPUT id=fax maxLength=40 name=fax><BR>Mobile Phone: <INPUT id=mobile maxLength=40 name=mobile><BR>Description: <TEXTAREA name=description></TEXTAREA><BR>Address: <TEXTAREA name=street></TEXTAREA><BR>City: <INPUT id=city maxLength=40 name=city><BR>State/Province: <INPUT id=state maxLength=20 name=state><BR>Zip: <INPUT id=zip maxLength=20 name=zip><BR>Country: <INPUT id=country maxLength=40 name=country><BR>Lead Source: <SELECT id=lead_source name=lead_source><OPTION value="" selected>--None--<OPTION value=Web>Web</OPTION> <OPTION value="Phone Inquiry">Phone Inquiry</OPTION> <OPTION value="Partner Referral">Partner Referral</OPTION> <OPTION value="Purchased List">Purchased List</OPTION> <OPTION value=Other>Other</OPTION></SELECT><BR>Industry: <SELECT id=industry name=industry><OPTION value="" selected>--None--<OPTION value=Agriculture>Agriculture</OPTION> <OPTION value=Apparel>Apparel</OPTION> <OPTION value=Banking>Banking</OPTION> <OPTION value=Biotechnology>Biotechnology</OPTION> <OPTION value=Chemicals>Chemicals</OPTION> <OPTION value=Communications>Communications</OPTION> <OPTION value=Construction>Construction</OPTION> <OPTION value=Consulting>Consulting</OPTION> <OPTION value=Education>Education</OPTION> <OPTION value=Electronics>Electronics</OPTION> <OPTION value=Energy>Energy</OPTION> <OPTION value=Engineering>Engineering</OPTION> <OPTION value=Entertainment>Entertainment</OPTION> <OPTION value=Environmental>Environmental</OPTION> <OPTION value=Finance>Finance</OPTION> <OPTION value="Food &amp; Beverage">Food &amp; Beverage</OPTION> <OPTION value=Government>Government</OPTION> <OPTION value=Healthcare>Healthcare</OPTION> <OPTION value=Hospitality>Hospitality</OPTION> <OPTION value=Insurance>Insurance</OPTION> <OPTION value=Machinery>Machinery</OPTION> <OPTION value=Manufacturing>Manufacturing</OPTION> <OPTION value=Media>Media</OPTION> <OPTION value="Not For Profit">Not For Profit</OPTION> <OPTION value=Recreation>Recreation</OPTION> <OPTION value=Retail>Retail</OPTION> <OPTION value=Shipping>Shipping</OPTION> <OPTION value=Technology>Technology</OPTION> <OPTION value=Telecommunications>Telecommunications</OPTION> <OPTION value=Transportation>Transportation</OPTION> <OPTION value=Utilities>Utilities</OPTION> <OPTION value=Other>Other</OPTION></SELECT><BR>Annual Revenue: <INPUT id=revenue name=revenue><BR>Employees: <INPUT id=employees name=employees><BR>Campaign: <SELECT id=Campaign_ID name=Campaign_ID><OPTION value="" selected>--None--<OPTION value=7013000000015p1>Greenville Magazine Ad</OPTION> <OPTION value=7013000000018gS>Yellow Pages</OPTION> <OPTION value=7013000000019dd>BBB</OPTION> <OPTION value=7013000000019cG>Ricky Ray</OPTION> <OPTION value=701300000001DqI>Internet Search</OPTION></SELECT><BR><INPUT id=member_status type=hidden name=member_status> Email Opt Out: <INPUT id=emailOptOut type=checkbox value=1 name=emailOptOut><BR>Fax Opt Out: <INPUT id=faxOptOut type=checkbox value=1 name=faxOptOut><BR>Do Not Call: <INPUT id=doNotCall type=checkbox value=1 name=doNotCall><BR>Request Sample Materials: <INPUT id=00N30000000nr2r type=checkbox value=1 name=00N30000000nr2r><BR>Product Interest: <SELECT id=00N30000000laQe multiple name=00N30000000laQe><OPTION value="Media Conversion (eg. VHS to DVD)">Media Conversion (eg. VHS to DVD)</OPTION> <OPTION value="Media Duplication">Media Duplication</OPTION> <OPTION value="Multimedia CDs">Multimedia CDs</OPTION> <OPTION value="Video Production">Video Production</OPTION> <OPTION value=Websites>Websites</OPTION></SELECT><BR><INPUT onclick="document.getElementById('Form').action='http://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';" type=submit value="Contact Sales"></span>

 

   <input name="ScrollTop" id="ScrollTop" type="hidden" />
   <input name="__dnnVariable" id="__dnnVariable" type="hidden" />
 </form>

OK, I'm very new to SalesForce and have been trawling the forums and support docs to no avail.

I am submitting an enquiry form using the WebToLead servlet and want to disable the retURL or control the way in which it is opened. i.e. I want to open it as a popup without toolbars and and have buttons that can refer to JS methods in the form page (pref. via window.opener).

If I disable the return page then I can handle everything via the form page itself.

Any suggestions?

TIA

Good morning everyone,

I have a customer that has a web page that uses the WebToLead servlet.  It has been working for them but they are trying to add some fields to the page but aren't having much luck.  We need to know the field names expected by the servlet.

Is this outdated functionality?  I cannot find any info on it, other than a few posts in the forums that generally are asking how to do something like WebToLead in the API.

Thanks in advance for your help,

Doug Waterfield
djw@iquest.net