You need to sign in to do that
Don't have an account?

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
)
(
[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
)
(
[done] => 1
[queryLocator] =>
[records] => Array
(
[0] => stdClass Object
(
[type] => Lead
[Id] => Array
(
[0] => 00Q3000000BK8qbEAD
[1] => 00Q3000000BK8qbEAD
)
)
...
Message Edited by benfaust on 07-24-2006 11:35 AM
string(67) "<sf:LastModifiedDate>2007-06-01T14:23:18.000Z</sf:LastModifiedDate>"
string(67) "<sf:LastModifiedDate>2007-06-01T14:23:18.000Z</sf:LastModifiedDate><sf:Variable>2007-06-01T14:23:18.000Z</sf:variable>"
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>');