1

I have a custom object that has more than 2000 records. I have a custom field, id__c, that is a number that is searchable. The records I have in there have id__c's ranging from 1 to 3000.

I am running into an issue with the default List that is created on the objects tab when you create a custom Object.

If I have the object's list sorted by id__c ascending, and search for 2000 the correct record appears, but if I search for 2001 it does not appear and I get No Results.

If I have the object's list sorted by id__c descending, and search for 2001 the correct record appears, but if I search for 999 is doesn't appear.

I can only assume that this has something to do with SF's 2000 limit restriction on OFFSET in SOQL and that they pre-load the first 2000 records and search through those results rather than actually search for all users?

EDIT:

As requested, here are some pictures of what I mean. For these pictures, I have sorted the list by 'Student Name'.

In this picture, you will see that when sorted by Name, the 2000th record is AGFEYTPtest854:

2000th record

In the next picture, I have reloaded the page and sorted by Name, and searched for AGFEYTPtest854 and you will see there is a search result:

AGFEYTPtest854

In this third picture, I searched for AGFEYTPtest855 and there is no results:

AGFEYTPtest855

And just to confirm that this record does in fact exist, here is my search result when I have the list sorted by a different field:

AGFEYTPtest855 - 2

So as you can see, I don't do the SOQL query. Why does this search bar only search for the first 2000 records depending on the current sort? Shouldn't a search on a particular list, you know, search the whole list?

  • 6
    Please post your actual SOQL query. – David Cheng Mar 22 at 20:45
  • It’s not an SOQL query, it’s the default List Salesforce creates for a new object, you know, like in an Objects Tab. I just said I can only assume the problem relates to SOQL restrictions. – BlondeSwan Mar 24 at 13:41
  • @BlondeSwan I think I follow you but a couple of screenshots might help show the behavior you're talking about. – David Reed Mar 24 at 13:55
  • @DavidReed I've added the screenshots for your viewing pleasure. – BlondeSwan Mar 28 at 22:24
1

max 2000 record per 1 query on listview is a standard limitation. https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_listviewresults.htm?search_text=list%20view

Lightning does not come out of the box with pagination on list views. However, in classic, with the enhanced UI, you can get pagination on list views. - Because it's implementing offseting on listview queries.

However, you can accomodate custom page on object tab which will include a lightning component work together with offsets and listviews somehow. For example, the dreamhouse example app has a paginator component written in LWC. https://github.com/dreamhouseapp/dreamhouse-lwc/tree/c7a6f90f55080524123fef25a293ded773b36b23/force-app/main/default/lwc/paginator

By checking it's references you can get a picture how you can accomplish it, if you want to.

Check out this discussions within this topic: https://success.salesforce.com/answers?id=9063A000000iS6cQAE https://success.salesforce.com/ideaView?id=0873A0000003bruQAA

  • What a pointless search bar... – BlondeSwan Mar 29 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.