Skip to main content

SOQL Offset

Explore practical guides and implementation patterns for this topic.

Posts

Topic LWC
Lightning Web Components

Migrate Visualforce Pagination to LWC: A Modern Server-Side Approach

Visualforce and the StandardSetController served us well for years, but the Salesforce ecosystem has firmly moved to Lightning Web Components (LWC). While Visualforce required complex Apex wrapper classes to handle simple UI checkboxes, LWC separates the data from the interface beautifully. Migrating your paginated tables to LWC drastically improves page load speeds, reduces server calls, and provides a much sleeker user experience. In plain words: Instead of relying on a clunky Visualforce server-side controller to remember which checkboxes you clicked, we use a modern LWC frontend with a lightning-datatable . We tell Apex exactly which "page" of data we want using SOQL OFFSET , and JavaScript handles remembering your selected rows instantly behind the scenes. Key Points for LWC Pagination No Wrapper Classes Needed: The lightning-datatable component natively supports row selection checkboxes. You do not need an Apex wrapper class just to track...
Read article
Topic LWC
Lightning Web Components

How to Build a Custom Visualforce Data Table with Pagination in Salesforce

In plain words: Data Table Pagination divides massive Salesforce datasets into bite-sized, sequential pages (e.g., 10 or 25 records per view). Instead of pulling thousands of records into the browser at once—which slows down the page and triggers the 170 KB Visualforce view state limit—pagination fetches only the current page's records on demand using server-side Apex queries or the StandardSetController . Displaying large datasets in Salesforce without pagination degrades page responsiveness and risks hitting platform limits. Querying thousands of records at once blows past the 50,000 SOQL row retrieval limit, inflates Visualforce View State beyond 170 KB, and creates a frustrating user experience. Implementing structured pagination in Apex and Visualforce gives users fast, predictable navigation while keeping platform resource consumption minimal. 1. Understanding Pagination Architecture in Salesforce Salesforce developers typically implement pagination...
Read article