sf-apex-cursor

Community

Scale Apex pagination to millions of rows

Authorjiten-singh-shahi
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Enables efficient pagination and processing of very large SOQL result sets without relying on OFFSET, avoiding heap bloat and OFFSET-driven performance degradation for large datasets.

Core Features & Use Cases

  • Server-side pagination at scale: use Database.Cursor to iterate up to 50,000,000 rows while keeping heap usage per-page only.
  • Async Queueable chaining: serialize cursor IDs and chain Queueable jobs to continue processing across transactions.
  • LWC and Flow integration: use PaginationCursor for @AuraEnabled endpoints to support infinite scroll and paged UI components.
  • Use Case: Replace OFFSET-based UI pagination or heavy Batch Apex jobs with cursor-based iteration to maintain performance beyond 2,000 rows.

Quick Start

Open a Database.Cursor for your SOQL, fetch pages of up to 2000 rows, and pass the cursor ID into chained Queueable jobs to process the full result set.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: sf-apex-cursor
Download link: https://github.com/jiten-singh-shahi/salesforce-claude-code/archive/main.zip#sf-apex-cursor

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.