function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
benfaustbenfaust 

Object Structure Confusion

We've been successfully retrieving a list of Lead and Contact results using php 5.1. We're querying the fields LastName, FirstName, Title, Street, City, State, PostalCode, Country, Phone, Email, and Id. When we add ANY other field, whether it's a standard field such as Fax or Description, or a custom field, the contents of the [any] part of the object changes from a value to an array containing two items.
 
Anyone have similar issues? This is a rush job and is turning into a time nightmare.
 
Before Any Additional Field:
stdClass Object
(
    [done] => 1
    [queryLocator] =>
    [records] => Array
        (
            [0] => stdClass Object
                (
                    [type] => Lead
                    [Id] => Array
                        (
                            [0] => 00Q3000000BK8qbEAD
                            [1] => 00Q3000000BK8qbEAD
                        )
                    [any] => BenFaustna /naVT12345ben@eem.tv89723472
                )
...
 
After Any Additional Field:
stdClass Object
(
    [done] => 1
    [queryLocator] =>
    [records] => Array
        (
            [0] => stdClass Object
                (
                    [type] => Lead
                    [Id] => Array
                        (
                            [0] => 00Q3000000BK8qbEAD
                            [1] => 00Q3000000BK8qbEAD
                        )
                    [any] => Array
                        (
                            [0] => BenFaustna /naVT12345ben@eem.tv89723472
                            [1] =>
                        )
                )
...

Message Edited by benfaust on 07-24-2006 11:35 AM

DG-AngelDG-Angel
Hi
 
How did u get the solution to this. I am getting this any object with lots of fields like this
 
["any"]=>
      string(67) "<sf:LastModifiedDate>2007-06-01T14:23:18.000Z</sf:LastModifiedDate>"
how do I extract the LastModifiedDate from here also if there are two tags in any object like this
 
["any"]=>
      string(67) "<sf:LastModifiedDate>2007-06-01T14:23:18.000Z</sf:LastModifiedDate><sf:Variable>2007-06-01T14:23:18.000Z</sf:variable>"
how do i extract both LastModifiedDate and Variable from this object here.
 
Thanks
DG
 
benfaustbenfaust

Make a new soap object out of the item. I believe it's something like this:

$results=new SObject($sfresults->records);

Please note I just pulled that object structure out of the air. You'll need to analyze the data with which you're working and experiment to determine which part of the data will return the desired results.

You may need to do a loop such as this:

$results=array();
foreach($sfresults->records as $result)
{
     $results[]=new SObject($result);
}
echo('<pre>');print_r($results);echo('</pre>');