function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Riadh MRiadh M 

SmartStore limit storing to 2000 record !!

Hello everyone,

 

I'm working on a mobile application using Jquery Mobile. My application handles offline mode, for that I use the SmartStore plugin. But I noticied that it is impossible to store more than 2000 records in one Soup. Is that normal ? Anyone else got the same problem ? Is There any trick allowing us to store more than 2000 records in a Soup ?

 

Thank you guys in advance for any lead.

Best Answer chosen by Admin (Salesforce Developers) 
Riadh MRiadh M

You are right !

I have finally been able to store more than 2000 records using the function queryMore of the forcetkclient. But still, if I try to get a huge number of records (like 200 000), the system do not respond anymore. Maybe the solution to that is to do it gradually, like fetch only 10 000 records each time.

 

Thanks for the respond anyway, I will consider the problem solved (because I can store more than 2000 records now).

For anyone interested, I have done the following : 

 

// I declare an array to store my results

var tempArray = [];

 

// I call the queryMore function. This function will call another function in the calback. This latter function (callbackFunction) contains a queryMore function too, which concats elemetns to the array and calls itself in the callback of the queryMore function

forcetkClient.queryMore(response.nextRecordsUrl, callbackFunction , error);

 

//This is the callback function

function callbackFunction (response) {

    tempArray = tempArray.concat(response.records);

    if (response.nextRecordsUrl {

        forcetkClient.queryMore(response.nextRecordsUrl, callbackFunction, error);

    }

    else

         // Here store in the soups with upsertSoupEntries

}

 

 

All Answers

Kevin HawkinsKevin Hawkins
What feedback are you getting to believe that SmartStore can only store 2000 records? It sounds possible that you're hitting the batch size limit on the number of records returned from the REST APIs.
elie8282elie8282

Do we need to use a Partner WSDL if we want to integrate custom objects in SF to a web application (iOS, Android)?  This web application has some data elements that need to be updating the SF Objects, also, some data from the SF objects (including chatter) need to be pushed to the web application (2-way interface). 

Any recommendations/suggestions will be greatly appreciated.

Thanks, 

Riadh MRiadh M

You are right !

I have finally been able to store more than 2000 records using the function queryMore of the forcetkclient. But still, if I try to get a huge number of records (like 200 000), the system do not respond anymore. Maybe the solution to that is to do it gradually, like fetch only 10 000 records each time.

 

Thanks for the respond anyway, I will consider the problem solved (because I can store more than 2000 records now).

For anyone interested, I have done the following : 

 

// I declare an array to store my results

var tempArray = [];

 

// I call the queryMore function. This function will call another function in the calback. This latter function (callbackFunction) contains a queryMore function too, which concats elemetns to the array and calls itself in the callback of the queryMore function

forcetkClient.queryMore(response.nextRecordsUrl, callbackFunction , error);

 

//This is the callback function

function callbackFunction (response) {

    tempArray = tempArray.concat(response.records);

    if (response.nextRecordsUrl {

        forcetkClient.queryMore(response.nextRecordsUrl, callbackFunction, error);

    }

    else

         // Here store in the soups with upsertSoupEntries

}

 

 

This was selected as the best answer
Gaurav KheterpalGaurav Kheterpal

@Kechmus - what issue did you face with a large number of records? I've used Smart Store in an app which has around a million records stored offline and it works pretty well. Perhaps, I can be of some help.

Riadh MRiadh M
Thanks for your reply. The problem I am facing is that the app loads forever without response when trying to fetch data from soups in an array for example. Maybe my recursive function is not that efficient, maybe you could handle me with a more efficient function.