Sub topic 5
Working with list views
This chapter assumes you know what an object, record, and field are. It also assumes you can open an object's tab in a Salesforce org that has standard objects such as Accounts. Filtering, display modes, and inline editing come in later chapters. Here you learn what a list view is and how to use one.
What a list view is
A list view is a saved set of filter rules, a column layout, and a sort order for one object. It shows the matching records as rows. You reach it from an object's home page, which you open from a tab in the navigation bar.
A list view does not copy data. It runs a query each time you open it. A view that filters Accounts by Industry and sorts by Name returns the same rows as this SOQL query:
SELECT Id, Name, Industry
FROM Account
WHERE Industry = 'Technology'
ORDER BY Name- The
SELECTfields are the columns. - The
WHEREclause is the filter. - The
ORDER BYclause is the sort.
Opening and switching views
Open the Accounts tab. The list view name appears at the top left, such as Recent Accounts. Click the name or the small arrow next to it to see the available views. Select one to load it.
Common built-in views include these:
- Recently Viewed: records you opened lately. Salesforce adds this view to every object, and it is not a full list of records.
- All: every record you are allowed to see.
- My views: for example, records you own.
Use the pin icon to make a view your default. Salesforce then opens it first whenever you open that object's tab.
Working in the list
- Click a column header to sort by that column. Click it again to reverse the order.
- Click a record name to open its record page.
- Use the search box above the list to find text within the current view only. It does not search the whole org.
- Use the refresh button after other people may have changed data.
Which views you see depends on sharing and permissions. A view named All Accounts shows only the records you can access, so two users can see different rows in the same view.
How views appear in URLs
The URL shows which view is open. The filterName value is the view's name or Id.
/lightning/o/Account/list?filterName=Recent
/lightning/r/Account/001XXXXXXXXXXXXXXX/viewThe first URL opens the Account list view named Recent. The second opens the view page of one Account record, where 001XXXXXXXXXXXXXXX stands for a real record Id. You can bookmark or share the first form to send someone straight to a view.
Common errors
- A record is missing from the view. The filter may exclude it, or sharing may hide it. Check the filter first, then check your access.
- The wrong view opens every time. You may have pinned a different view. Pin the one you want.
- Searching inside the list finds nothing. That search covers only the loaded view. Use global search for org-wide results.
- A view you expect is not listed. Views may be private to another user or shared with specific groups only.
Exercise
Two colleagues open the same shared list view, All Accounts, and see different numbers of rows. Give one likely reason, and say what part of the equivalent SOQL query does not change between them.
Show answer
Sharing and permissions control which records each user can access, so the same view returns different rows for each person. The filter, columns, and sort order (the WHERE, SELECT, and ORDER BY parts) are the same for both users.
Exercise
You search for "Acme" in the search box above the Recently Viewed list and find nothing, but you know an Acme account exists. What should you do?
Show answer
The box searches only within the current view. Switch to the All view, or use global search, to find the record.