Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions forcetk.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,30 @@ if (forcetk.Client === undefined) {
this.ajax('/' + this.apiVersion + '/query?q=' + escape(soql)
, callback, error);
}

/*
* Queries the next set of records based on pagination.
* <p>This should be used if performing a query that retrieves more than can be returned
* in accordance with http://www.salesforce.com/us/developer/docs/api_rest/Content/dome_query.htm</p>
* <p>Ex: forcetkClient.queryMore( successResponse.nextRecordsUrl, successHandler, failureHandler )</p>
*
* @param url - the url retrieved from nextRecordsUrl or prevRecordsUrl
* @param callback function to which response will be passed
* @param [error=null] function to which jqXHR will be passed in case of error
*/
forcetk.Client.prototype.queryMore = function( url, callback, error ){
//-- ajax call adds on services/data to the url call, so only send the url after
var serviceData = "services/data";
var index = url.indexOf( serviceData );

if( index > -1 ){
url = url.substr( index + serviceData.length );
} else {
//-- leave alone
}

this.ajax( url, callback, error );
}

/*
* Executes the specified SOSL search.
Expand Down