• Superdude
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
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.
I have a contact form on my website and would like to pass info that the users post to salesforce (as a lead) using ajax.  Is it possible to do this, and does anyone have an example if it is.
 
Cheers
I have two questions (and some code below)
 
Q1. How to set up a trace:
I am trying to insert new lead information into salesforce, but without too much luck. The connection part of the code works and the response comes back without any errors. But when I go to saleforce nothing has been added to the database.
 
What I would like to do is trace the soap messages to see what is happening, but am unsure how to do this. Can anyone help me out.
 
I've installed TcpTrace and set it to run on port 8080. I have also changed  the partner.wsdl.xml file on my local server (running on port 80) to point to TcpTrace, ala:
 
<service name="SforceService">
        <documentation>Sforce SOAP API</documentation>
        <port binding="tns:SoapBinding" name="Soap">
          <soap:address location="http://localhost:8080/>
        </port>
  </service>
 
In TcptTrace I have set the destination server to salesforce: https://na5-api.salesforce.com/services/Soap/u/8.0 and the destination port to 80.
 
When I try running the code with the TcpTrace changes it just hangs and nothing is shown in the trace window.
 
Does anyone have clear instructions on how to set up a trace using a similar method?
 
Q2 .What info does the create response object return
 
As mentioned above, I'm trying to add a new lead to salesforce and am using the create method to do this. I'd really like to know what salesforce is returning  - i.e what exactly is the create response object and what info does it contain. So far, I have only got as far as figuring out that it has one field that's an array.How do I get info from $createResponse (please see code below.) .Is it something like: $createResponse->Array["somefield"].
 
Any help would be greatly appreciated.
 
 
 
 
require('../soapclient/SforcePartnerClient.php');
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
$mylogin = $mySforceConnection->login("myemailaddress", "password");
$createFields = array (
  'FirstName' => 'bob',
  'LastName' => 'smith',
  'Email' => 'bob@googlemail.com',
  'PostalCode' => 'KY11 3bz',
  'City' => 'Edinburgh',
  'Website' => 'http://www.bobsite.com',
  'LeadSource' => 'WEB'
);
$sObject1 = new SObject();
$sObject1->fields = $createFields;
$sObject1->type = 'Lead';
try {
  $createResponse = $mySforceConnection->create(array ($sObject1));
} catch (SoapFault $fault) {
 echo $this->fail($fault->faultstring);
}
if($createResponse==true) echo "all okay";
 
 
 
 
Cheers Richard
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.
I have a contact form on my website and would like to pass info that the users post to salesforce (as a lead) using ajax.  Is it possible to do this, and does anyone have an example if it is.
 
Cheers
I have two questions (and some code below)
 
Q1. How to set up a trace:
I am trying to insert new lead information into salesforce, but without too much luck. The connection part of the code works and the response comes back without any errors. But when I go to saleforce nothing has been added to the database.
 
What I would like to do is trace the soap messages to see what is happening, but am unsure how to do this. Can anyone help me out.
 
I've installed TcpTrace and set it to run on port 8080. I have also changed  the partner.wsdl.xml file on my local server (running on port 80) to point to TcpTrace, ala:
 
<service name="SforceService">
        <documentation>Sforce SOAP API</documentation>
        <port binding="tns:SoapBinding" name="Soap">
          <soap:address location="http://localhost:8080/>
        </port>
  </service>
 
In TcptTrace I have set the destination server to salesforce: https://na5-api.salesforce.com/services/Soap/u/8.0 and the destination port to 80.
 
When I try running the code with the TcpTrace changes it just hangs and nothing is shown in the trace window.
 
Does anyone have clear instructions on how to set up a trace using a similar method?
 
Q2 .What info does the create response object return
 
As mentioned above, I'm trying to add a new lead to salesforce and am using the create method to do this. I'd really like to know what salesforce is returning  - i.e what exactly is the create response object and what info does it contain. So far, I have only got as far as figuring out that it has one field that's an array.How do I get info from $createResponse (please see code below.) .Is it something like: $createResponse->Array["somefield"].
 
Any help would be greatly appreciated.
 
 
 
 
require('../soapclient/SforcePartnerClient.php');
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
$mylogin = $mySforceConnection->login("myemailaddress", "password");
$createFields = array (
  'FirstName' => 'bob',
  'LastName' => 'smith',
  'Email' => 'bob@googlemail.com',
  'PostalCode' => 'KY11 3bz',
  'City' => 'Edinburgh',
  'Website' => 'http://www.bobsite.com',
  'LeadSource' => 'WEB'
);
$sObject1 = new SObject();
$sObject1->fields = $createFields;
$sObject1->type = 'Lead';
try {
  $createResponse = $mySforceConnection->create(array ($sObject1));
} catch (SoapFault $fault) {
 echo $this->fail($fault->faultstring);
}
if($createResponse==true) echo "all okay";
 
 
 
 
Cheers Richard