forrest
forrest copied to clipboard
Handling nextRecordsUrl
trafficstars
Love the interface you've provided for laravel. One issue I've ran into though is that there is no way to handle the nextRecordsUrl returned from Salesforce in the case of a large result set being returned.
I had to modify the query function in client.php to the following
public function query($query, $options = [], $nextUrl = false)
{
$url = $this->instanceURLRepo->get();
$url .= $this->resourceRepo->get('query');
if ($nextUrl == true) {
$url .= '/';
}
if ($nextUrl == false) {
$url .= '?q=';
}
$url .= urlencode($query);
$queryResults = $this->request($url, $options);
return $queryResults;
}
This will allow users to pass in the nextRecordsUrl returned by salesforce to get the next set of records.
Something like that could be built, but I feel that would make this library a little too opinionated.
For instance, there might be situations where an application would like to handle returning the next set of records a certain way.
I'll leave the issue open in case others have input.