• sissyphus
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
I am using:
PHP toolkit-11_0b
PHP 5.1.6
Salesforce API version 11


I am trying to retrieve the Account name or id, when querying on Cases from the API, but I could not find a way to do that:

SELECT Id, Account.Name FROM Case --> Doe not work with PHP

SELECT Id, AccountId FROM Case --> No such column 'AccountId' on entity 'Case'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

SELECT Name, (SELECT Id FROM Cases WHERE Id = '".$MyCase->Id."') FROM Account --> Didn't understand relationship 'Cases' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


Someone can help me on that?
Thanks a lot,
Etienne
The PHP toolkit provides you an easy way to make Web service API method calls.

Newly supported or enhanced in this release are:
* Metadata API
* Email
* Merge
* Workflow
* EmptyRecycleBin
* Proxy Server
* LoginScopeHeader
* Header Options at the Connection Level

Click this link to enjoy.  Be sure to check out the extensive Samples section as well.


Can any one tell me how to access Contact.Name form my code below, you can see I'm echo out a few different ways but nothing seems to work:
 
$strSQL = "SELECT Id,AssetId,AccountId, Contact.FirstName, ";
$strSQL .= "CaseNumber,Subject,Status,CreatedDate,What_is_your_acronym__c,Which_product__c ";
$strSQL .= "FROM Case ORDER BY Id DESC LIMIT 2 ";
 
   $Result = $mySforceConnection->query($strSQL);
 
 if ($Result->size == 0) {
  NoRecords(0);
 }else{
 
  $records = $Result->records;
  
  foreach ($records as $record) {
  
      $sObject = new SObject($record);
   
   echo $sObject->fields->CaseNumber.":: ";
   echo $sObject->fields->Contact->FirstName."<br>";
   echo $sObject->fields->FirstName;
  }
 }