• ch3f
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am just starting out developing to this API.  I have php code that is not returning the same result and the IDE query when a custom field is in the statment.

 

 

<?php define("SOAP_CLIENT_BASEDIR", "soapclient"); require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php'); require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php'); require_once (SOAP_CLIENT_BASEDIR.'/function.php'); require_once ('userAuth.php'); try { $mySforceConnection = new SforceEnterpriseClient(); $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl'); $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD); $query = "Select Name, CID__c, BillingCity, Account_Executive__c From Account a limit 20"; $something = "SELECT OwnerId Owner.Alias FROM Lead limit 1"; $createResponse = $mySforceConnection->query($query); echo "<table border=1 cellpadding=2>"; echo "<tr>"; echo "<th> Name </th>"; echo "<th> CID </th>"; echo "<th> City </th>"; echo "<th> Account Executive </th>"; echo "</tr>"; foreach ($createResponse as $createResult){ //print_r($createResult); //print("<br>"); for ($i=0, $num_result=count($createResult); $i < $num_result; $i++){ echo "<tr>"; echo "<td>"; print($createResult[$i]-> Name); echo "</td>"; echo "<td>"; print($creatResult[$i]-> CID__c ); echo "</td>"; echo "<td>"; print($createResult[$i]-> BillingCity ); echo "</td>"; echo "<td>"; print( $createResult[$i]-> Account_Executive__c ); echo "</td>"; echo "</tr"; } } echo "<table border=\"1\">"; } catch (Exception $e) { echo $mySforceConnection->getLastRequest(); echo "</br>"; echo "<h1>faultstring:</h1> </br>"; echo $e->faultstring; echo "</br>"; return $return; } ?>

 

The Custom fields come out blank.  However when I run the same SOQL query in Eclipse I get the records for the custom fields.  Am I doing this correctly?  I have read about cached data could this be my problem?

 

 

 

  • March 10, 2010
  • Like
  • 0

I am just starting out developing to this API.  I have php code that is not returning the same result and the IDE query when a custom field is in the statment.

 

 

<?php define("SOAP_CLIENT_BASEDIR", "soapclient"); require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php'); require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php'); require_once (SOAP_CLIENT_BASEDIR.'/function.php'); require_once ('userAuth.php'); try { $mySforceConnection = new SforceEnterpriseClient(); $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl'); $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD); $query = "Select Name, CID__c, BillingCity, Account_Executive__c From Account a limit 20"; $something = "SELECT OwnerId Owner.Alias FROM Lead limit 1"; $createResponse = $mySforceConnection->query($query); echo "<table border=1 cellpadding=2>"; echo "<tr>"; echo "<th> Name </th>"; echo "<th> CID </th>"; echo "<th> City </th>"; echo "<th> Account Executive </th>"; echo "</tr>"; foreach ($createResponse as $createResult){ //print_r($createResult); //print("<br>"); for ($i=0, $num_result=count($createResult); $i < $num_result; $i++){ echo "<tr>"; echo "<td>"; print($createResult[$i]-> Name); echo "</td>"; echo "<td>"; print($creatResult[$i]-> CID__c ); echo "</td>"; echo "<td>"; print($createResult[$i]-> BillingCity ); echo "</td>"; echo "<td>"; print( $createResult[$i]-> Account_Executive__c ); echo "</td>"; echo "</tr"; } } echo "<table border=\"1\">"; } catch (Exception $e) { echo $mySforceConnection->getLastRequest(); echo "</br>"; echo "<h1>faultstring:</h1> </br>"; echo $e->faultstring; echo "</br>"; return $return; } ?>

 

The Custom fields come out blank.  However when I run the same SOQL query in Eclipse I get the records for the custom fields.  Am I doing this correctly?  I have read about cached data could this be my problem?

 

 

 

  • March 10, 2010
  • Like
  • 0