• Jim Anderson
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 7
    Replies
Does any one know of any good web hosting vendors that support PHP5 and connecting to Salesforce.com api with the PHP tool kit?
 
Thanks!
 
 
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;
  }
 }
When I query:
 
SELECT Field,OldValue, NewValue,  CreatedDate, CreatedById....
 
I can get all the field values but not the OldValue and Newvalue.
 
$sObject->fields->Field works perfect and then on the next line i have $sObject->fields->OldValue and I cant get the value, it prints out blank, but I know there is a value. I can see it in my results:
 
stdClass Object ( [done] => 1 [queryLocator] => [records] => Array ( [0] => stdClass Object ( [type] => CaseHistory [Id] => [any] => Array ( [0] => Status [1] => New [2] => Closed [3] => 2007-06-08T14:25:39.000Z00530000000j2ppAAA ) ) [1] => stdClass Object ( [type] => CaseHistory [Id] => [any] => Array ( [0] => Subject [1] => Password Reset [2] => Password Reset 2 [3] => 2007-06-08T14:01:10.000Z00530000000j2ppAAA ) ) [2] => stdClass Object ( [type] => CaseHistory [Id] => [any] => created2007-06-08T12:59:55.000Z00530000000j2ppAAA ) [3] => stdClass Object ( [type] => CaseHistory [Id] => [any] => Array ( [0] => ownerAssignment [1] => Jim Anderson [2] => Response Line Function [3] => 2007-06-08T12:59:55.000Z00530000000j2ppAAA ) ) [4] => stdClass Object ( [type] => CaseHistory [Id] => [any] => Array ( [0] => ownerAssignment [1] => 00530000000j2ppAAA [2] => 00G300000017HLWEA2 [3] => 2007-06-08T12:59:55.000Z00530000000j2ppAAA ) ) ) [size] => 5 )
 
 
Am I missing something????
 
 
I'm trying to query the Solutions Object like you can in the SelfServicePortal to get a ranked result..does anyone know if that is possible through the api?
 

 Hi All,

I need to create a case from the api and I have that part working but I need to set the AssignmentRuleHeader to use the defaul rules and I cant find any samples.  I'm lot on where or how to set it in my code. I see the functions are there in php toolkit.

Any help would be great...been at it for a few hours.

Thanks!

 

    $mySforceConnection = new SforcePartnerClient();
    $mySforceConnection->createConnection(SF_WSDL);
    $loginResult = $mySforceConnection->login(SF_USER_NAME, SF_PASSWORD);

try {
 
        $createFields = array (
          'Subject' => 'This is a test Case',
        );
        $sObject1 = new SObject();
        $sObject1->fields = $createFields;
        $sObject1->type = 'Case';
        $createResult = $mySforceConnection->create(array (
          $sObject1
        ));


  echo "<br>Case: ".$createResult->id;

    } catch (Exception $e) {
      global $errors;
      $errors = $e->faultstring;
      echo $errors;
    }

Hi,
 
Is there a was to auto-assign a webToCase Case to contact that exists already?  Can I pass other info like salesforce contactID or something?
 
Thanks
Jim
We are going to be using PHP to access the API and I was wondering how others have gotten around the 5 connection limit to the API.  Are you using some kind of application pooling?
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;
  }
 }
Hello everyone....

I'm trying to query the salesforce database... I can successfuly login into the salesforce, but there seems to be something wrong with the query... can anybody help me here?

I'm ussing a login code, and then this...

try
{
    $result = $sforce->query(array("queryString" => "select Id from Lead where Lead.FirstName='Miguel'"));
    print_r($result);
    print "I'm not reaching this print";
} catch (Exception $e)
{
    print_r($e);
}


what happens is that it doesn't print the "I'm not reaching this print"... can anyone help me with this?
thank you

M.

  • June 12, 2007
  • Like
  • 0
I'm trying to query the Solutions Object like you can in the SelfServicePortal to get a ranked result..does anyone know if that is possible through the api?
 
We are going to be using PHP to access the API and I was wondering how others have gotten around the 5 connection limit to the API.  Are you using some kind of application pooling?