• Carlton Banks
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I cannot get this to work.  I can query each field seperately but together I get errors.  Can someone please
tell me what I am doing wrong?
 
 
Code:
//connect to salesforce
    $client = new SforcePartnerClient();
    $client->createConnection($wsdl);
    $loginResult = $client->login($userName, $password);


$string = "SELECT Description, (SELECT TrackingNumber__c FROM Opportunity) FROM OpportunityLineItem";

$response = $client->query($string);
$queryresult = new QueryResult($response);   

 
foreach($queryresult->records as $result)
{    

  $Description = $result->fields->Description;
  $TrackingNumber = $result->fields->TrackingNumber__c;
   
      echo "Description: " . $Description . "<br />";
      echo "Tracking Number: " . $TrackingNumber . "<br /><br /><br />";

}