Model.debug: Pagination limit reached

Pat Vachon
Pat Vachon πŸ’ŽπŸ’ŽπŸ’Ž
edited June 25, 2020 in Questions
This is an odd one. I have a snippet that is attempting to query Tasks and Events for eventually export as one file.

Everything seems to be working until the second time the loadmore function is run on TaskExport resulting in 3000 records loaded when there are many more. The model debug property reads "Pagination limit reached" and can't load any more records. Is this a Skuid or Salesforce thing? Is there a suggested workaround?

The last SOQL statement for TaskExport:

"SELECTΒ  --- fields --- FROM Task WHERE (Interaction_Type_Bucket__c in ('Hubspot'))AND(Start_Date__c != null) LIMIT 1001 OFFSET 2000"

Here's the snippet.Β 
skuid.snippet.register('exportActivities',function(args) {var params = arguments[0],
TaskExport = skuid.$M('TaskExport'), EventExport = skuid.$M('EventExport'), ActivitiesExport = skuid.$M('ActivitiesExport'), rows = [], activityModels = [TaskExport,EventExport], inputfilename = params.$Input.Filename, chartId = params.$Input.chartId, condition, $ = skuid.$; var dfd = $.Deferred(); function loadmore(model){ model.loadNextOffsetPage(function (){ continueLoadingOrNot(model); }); } function continueLoadingOrNot(model){ if(model.canRetrieveMoreRows){ loadmore(model); } else if (!TaskExport.canRetrieveMoreRows && EventExport.canRetrieveMoreRows){ loadmore(EventExport); } else if (!TaskExport.canRetrieveMoreRows && !EventExport.canRetrieveMoreRows){ rows =; ActivitiesExport.adoptRows(rows); ActivitiesExport.sortData('StartDate'); ActivitiesExport.exportData({ fileName: inputfilename, doNotAppendRowIdColumn: true, }); $.unblockUI(); dfd.resolve(); } } function failedLoad(){ $.blockUI({ message: 'Something went wrong', timeout: 3000 }); dfd.reject(); } function setCondition(model,conditionName,{value, values}){ condition = model.getConditionByName(conditionName); if (condition.operator == 'in'){ model.setCondition(condition,values); } else { model.setCondition(condition,value); } model.activateCondition(condition); } // deactivate other export conditions $.each(activityModels, function(m,model){ $.each(model.conditions, function(c,condition){ if ( && !"master_") && !"activity_master_")){ model.deactivateCondition(condition); } }); }); // set activites based on specific tab if (chartId == 'sales_all_monthly_by_bucket'){ $.each(activityModels, function(m,model){ setCondition(model,'Interaction_Type_Bucket__c',{values: ['Hubspot']}); }); } $.when(skuid.model.updateData(activityModels)) .done(function(){ // dfd.resolve(); continueLoadingOrNot(TaskExport); }) .fail(function(){ failedLoad(); }); return dfd.promise(); });


  • Pat Vachon
    Pat Vachon πŸ’ŽπŸ’ŽπŸ’Ž
    edited June 25, 2020

    Seems like there's a limit to pagination of 2,000.

    So, that basically means that I can get a max 4000 records so long as the 2000 records doesn't cause an apex heap size error. In my case it does. :/

    My workaround is to use the following as a framework in my snippet.

    Workaround for offset 2000 limit on SOQL query
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!