3

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?

4
  • 6
    Please post your actual SOQL query. Mar 22, 2019 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, 2019 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, 2019 at 13:55
  • @DavidReed I've added the screenshots for your viewing pleasure.
    – BlondeSwan
    Mar 28, 2019 at 22:24

1 Answer 1

2

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

2
  • What a pointless search bar...
    – BlondeSwan
    Mar 29, 2019 at 18:12
  • If folks could kindly upvote ideas.salesforce.com/s/idea/a0B8W00000GdWgTUAV/…. In the meantime, an interesting hack could be to auto-create list views via the meta-data API depending on the # of records. So for example, if a list view would normally be 4,900 rows then create 6 list views of 2k rows each. Very hacky but fun (depending on who you ask). Feb 9 at 0:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .