File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -430,6 +430,30 @@ if (forcetk.Client === undefined) {
430430 this . ajax ( '/' + this . apiVersion + '/query?q=' + escape ( soql )
431431 , callback , error ) ;
432432 }
433+
434+ /*
435+ * Queries the next set of records based on pagination.
436+ * <p>This should be used if performing a query that retrieves more than can be returned
437+ * in accordance with http://www.salesforce.com/us/developer/docs/api_rest/Content/dome_query.htm</p>
438+ * <p>Ex: forcetkClient.queryMore( successResponse.nextRecordsUrl, successHandler, failureHandler )</p>
439+ *
440+ * @param url - the url retrieved from nextRecordsUrl or prevRecordsUrl
441+ * @param callback function to which response will be passed
442+ * @param [error=null] function to which jqXHR will be passed in case of error
443+ */
444+ forcetk . Client . prototype . queryMore = function ( url , callback , error ) {
445+ //-- ajax call adds on services/data to the url call, so only send the url after
446+ var serviceData = "services/data" ;
447+ var index = url . indexOf ( serviceData ) ;
448+
449+ if ( index > - 1 ) {
450+ url = url . substr ( index + serviceData . length ) ;
451+ } else {
452+ //-- leave alone
453+ }
454+
455+ this . ajax ( url , callback , error ) ;
456+ }
433457
434458 /*
435459 * Executes the specified SOSL search.
You can’t perform that action at this time.
0 commit comments