You need to sign in to do that
Don't have an account?
Nadula
Using executeListView() in PHP
You can use this function to retrieve list view data from Salesforce via SOAP API.
Since this function is new, I couldn't find any useful resources on the internet. And PHP Toolkit 20.0 does not work with this new function.
Hence here goes my attempt and it works.
Sample code:
This is how I manage to run this API call without uisng PHP Toolkit 20.0
Hope this helps someone.
Cheers
Nadula
Since this function is new, I couldn't find any useful resources on the internet. And PHP Toolkit 20.0 does not work with this new function.
Hence here goes my attempt and it works.
Sample code:
$ListViewOrderBy = new stdclass(); $ListViewOrderBy->fieldNameOrPath = "Id"; $ListViewOrderBy->nullsPosition = "first"; $ListViewOrderBy->sortDirection = "ascending"; $ExecuteListViewRequest = new stdclass(); $ExecuteListViewRequest->request = new stdclass(); $ExecuteListViewRequest->request->developerNameOrId = "Your ListViewID"; $ExecuteListViewRequest->request->limit = 5000; //$ExecuteListViewRequest->request->offset = 0; $ExecuteListViewRequest->request->orderBy = $ListViewOrderBy; $ExecuteListViewRequest->request->sobjectType = "Lead"; $response = $sfConnection->executeListView($ExecuteListViewRequest);And access data using following:
foreach($response->result->records as $record) { }
This is how I manage to run this API call without uisng PHP Toolkit 20.0
$sfConnection = new SoapClient($wsdl_path); //Login $loginResult = $sfConnection->login(array ( 'username' => $USERNAME, 'password' => $PASSWORD )); $sessionHeader = new SoapHeader("urn:enterprise.soap.sforce.com", "SessionHeader", array('sessionId' => $loginResult->result->sessionId)); $sfConnection->__setSoapHeaders($sessionHeader); $sfConnection->sessionId = $loginResult->result->sessionId; $serverURL = $loginResult->result->serverUrl; $sfConnection->location = $serverURL;
Hope this helps someone.
Cheers
Nadula