You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
I have been running PHP Toolkit 20 for the longest time on PHP 5.3.8. I am in the process of migrating to a PHP 5.5.9 Server and am having big issues with the QueryResults.
============= START CODE ===========
createConnection(SALESFORCE_WSDL);
$mylogin = $mySforceConnection->login(SALESFORCE_USER, SALESFORCE_PASS . SALESFORCE_TOKEN);
$query = "SELECT Id, Name, Account_Owner_Name__c, Membership_Owner_Name__c, Sales_Initiator_Name__c FROM Account LIMIT 1";
$options = new QueryOptions(200);
$mySforceConnection->setQueryOptions($options);
$response = $mySforceConnection->query($query);
$queryResult = new QueryResult($response);
!$done = false;
echo "Size of records: ".$queryResult->size."\n ";;
$i = 0;
if ($queryResult->size > 0) {
while (!$done) {
foreach ($queryResult->records as $record) {
// $namevalue = $record->fields->Name."\r\n";
var_dump($queryResult);
```
// REF 1: Line below works, but is putting all data in for string fields in record->any value.
// echo " " . $i . "--AccountID: " . $record->Id[0] . " AccountName: " . $record->any . " ";
// REF 2: Line below only returns record->Id value. Only if Id[0] and not ->Id as in old toolkit.
```
// echo " " . $i . "--AccountID: " . $record->Id[0] . " AccountName: " . $record->fields->Name . " AccountOwner: " . $record->fields->Account_Owner_Name__c . " MembershipOwner: " . $record->fields->Membership_Owner_Name__c . " SalesInitiator: " . $record->fields->Sales_Initiator_Name__c . " ";
$i++;
}
if ($queryResult->done != true) {
echo "****\* Get Next Chunk *****\n";
try {
$response = $mySforceConnection->queryMore($queryResult->queryLocator);
$queryResult = new QueryResult($response);
} catch (Exception $e) {
print_r($mySforceConnection->getLastRequest());
echo $e->faultstring;
}
} else {
$done = true;
}
}
}
} catch (Exception $e) {
print_r($mySforceConnection->getLastRequest());
echo $e->faultstring;
}
?>
My var_dump of the query returns all the fields from Name to Sales_Initiator_Name__c as a string that is concatenated. (EG. REF 1)
I would like to get REF 2 working, NULLs are returned for $record->fields->Sales_Initiator_Name__c
or $record->Sales_Initiator_Name__c
Any ideas on how to update the toolkit to work with PHP 5.5.9 or higher. The above functionality is working with no issues on PHP 5.3.8
Thanks,
Jason
The text was updated successfully, but these errors were encountered:
I have been running PHP Toolkit 20 for the longest time on PHP 5.3.8. I am in the process of migrating to a PHP 5.5.9 Server and am having big issues with the QueryResults.
============= START CODE =========== createConnection(SALESFORCE_WSDL); $mylogin = $mySforceConnection->login(SALESFORCE_USER, SALESFORCE_PASS . SALESFORCE_TOKEN); $query = "SELECT Id, Name, Account_Owner_Name__c, Membership_Owner_Name__c, Sales_Initiator_Name__c FROM Account LIMIT 1"; $options = new QueryOptions(200); $mySforceConnection->setQueryOptions($options); $response = $mySforceConnection->query($query); $queryResult = new QueryResult($response); !$done = false; echo "Size of records: ".$queryResult->size."\n
";; $i = 0; if ($queryResult->size > 0) { while (!$done) { foreach ($queryResult->records as $record) { // $namevalue = $record->fields->Name."\r\n"; var_dump($queryResult); ``` // REF 1: Line below works, but is putting all data in for string fields in record->any value. // echo "
" . $i . "--AccountID: " . $record->Id[0] . " AccountName: " . $record->any . "
"; // REF 2: Line below only returns record->Id value. Only if Id[0] and not ->Id as in old toolkit. ``` // echo "
" . $i . "--AccountID: " . $record->Id[0] . " AccountName: " . $record->fields->Name . " AccountOwner: " . $record->fields->Account_Owner_Name__c . " MembershipOwner: " . $record->fields->Membership_Owner_Name__c . " SalesInitiator: " . $record->fields->Sales_Initiator_Name__c . "
"; $i++; } if ($queryResult->done != true) { echo "****\* Get Next Chunk *****\n"; try { $response = $mySforceConnection->queryMore($queryResult->queryLocator); $queryResult = new QueryResult($response); } catch (Exception $e) { print_r($mySforceConnection->getLastRequest()); echo $e->faultstring; } } else { $done = true; } } } } catch (Exception $e) { print_r($mySforceConnection->getLastRequest()); echo $e->faultstring; } ?>
==============END CODE ==============
The Query: $query = "SELECT Id, Name, Account_Owner_Name__c, Membership_Owner_Name__c, Sales_Initiator_Name__c FROM Account LIMIT 1";
object(QueryResult)#41 (6) { ["queryLocator"]=> NULL ["done"]=> bool(true) ["records"]=> array(1) { [0]=> object(stdClass)#42 (3) { ["type"]=> string(7) "Account" ["Id"]=> array(2) { [0]=> string(18) "0015000000lBvMaAAK" [1]=> string(18) "0015000000lBvMaAAK" } ["any"]=> string(242) "Kvh Industries, Inc.Erik AbergKevin GrahamAdam Herbert" } } ["size"]=> int(1) ["pointer"]=> int(0) ["sf":"QueryResult":private]=> bool(false) }
My var_dump of the query returns all the fields from Name to Sales_Initiator_Name__c as a string that is concatenated. (EG. REF 1)
I would like to get REF 2 working, NULLs are returned for $record->fields->Sales_Initiator_Name__c
or $record->Sales_Initiator_Name__c
Any ideas on how to update the toolkit to work with PHP 5.5.9 or higher. The above functionality is working with no issues on PHP 5.3.8
Thanks,
Jason
The text was updated successfully, but these errors were encountered: