
Apex Cursors: Process Millions of Records in Chunks Without Batch Apex
Use Database.getCursor and PaginationCursor to walk very large SOQL results from Queueable jobs and LWC pages, with limits, chaining, tests and a Node model.
Tag
38 guides tagged Apex.

Use Database.getCursor and PaginationCursor to walk very large SOQL results from Queueable jobs and LWC pages, with limits, chaining, tests and a Node model.

Speed up Apex and LWC with Platform Cache: org and session partitions, CacheBuilder, TTL choices, fallbacks that never break a request, and a tested model.

Use the new Web Console, trace flags, debug levels and the CLI to read Apex logs, spot queries in loops and limit pressure, with a tested log analyzer.

Agents retry, users repeat themselves and tools time out. Build idempotent Agentforce actions with deterministic keys, a ledger and tests so a refund happens once.

Sync batches where some records fail: per-record status, external IDs, SaveResult mapping, backoff, dead-lettering and retry-only-failures in Apex and Node.

Handle the timeout where the other side actually succeeded: idempotency keys, external IDs, a request ledger, retry classification and tests in Apex and Node.

Handle Apex errors the right way: try/catch/finally, custom exceptions, partial DML results, savepoints and a platform-event logger, with full tests.

Build approvals the Salesforce way: approval processes, submitting and deciding in Apex, and Flow Orchestrator stages for multi-team workflows, with tests.

Choose between custom metadata, custom settings and custom labels, deploy configuration, read it in Apex and LWC, and test code that depends on it.

Build Apex queries at runtime safely with bind maps, allow-lists and Schema describe, add SOSL text search, and test it all with a flexible search service.

Choose and build screen, scheduled and autolaunched flows, call a flow from Apex, and check flow metadata for loops, fault paths and hard-coded ids.

Design Prompt Builder templates with merge fields and grounding, call them from Apex through a testable wrapper, and check prompts and answers with a lint kit.

Learn SOQL relationship queries, subqueries, semi and anti-joins, polymorphic fields and aggregates with a tested Apex pipeline report, setup steps and limits.

Connect Slack to Salesforce with an auth provider and Named Credential, build tested Apex actions for channels and messages, and deploy the agent to Slack.

Build reliable agent actions: bulk-safe invocable Apex with clear descriptions, an idempotent write action, a Flow action with a fault path, and tests.

Build your first Agentforce service agent: setup, agent user, subagents, Apex actions, preview and tests, with an order status and returns scenario.

Expose your own REST endpoint with @RestResource: idempotent upserts, validation, versioned URLs, security, partner setup and full tests.

Call external APIs from Apex safely: credentials model, a reusable client, a tested retry policy, Queueable finalizers and dead-letter records.

Build reliable background processing: chained queueables, finalizers, platform-event alerts, backoff retries, idempotency keys and AsyncApexJob monitoring.

Design maintainable Apex: interfaces, abstract classes, a metadata-driven factory, service and selector layers and secure data access, with tests.

Learn Apex classes by building a B2B quote pricing service: methods, constructors, interfaces, access, sharing, user mode, tests and limits.

Enforce CRUD, FLS and sharing in Apex with user mode, stripInaccessible and justified system mode, plus tests with real permission sets and a migration script.

Go deeper on triggers: the save order, recursion and re-entrancy, mixed DML, async handoff, platform events and partial-success DML in an order-to-cash build.

Learn Apex trigger events, context variables, before vs after, addError and bulk-safe related-record updates with a lead and opportunity sales-ops build.

Learn Batch Apex end to end: start/execute/finish, scope size, Database.Stateful, error summaries, platform events, chaining, scheduling and testing.

How @future methods work, their limits, callouts, the mixed DML workaround and when to migrate to Queueable, using a partner onboarding build.

Learn Queueable Apex end to end: enqueueing, callouts, chaining, transaction finalizers, AsyncOptions, retries and testing with an enrichment pipeline.

Run Apex on a schedule: cron syntax, System.schedule, Setup scheduling, batch and queueable hand-off, and tests, built on a nightly SLA-breach sweep.

Why Apex triggers must handle 200 records at a time, and how Sets, Maps, aggregate and relationship queries keep a renewal trigger under governor limits.

Compare profiles and permission sets with a regulated onboarding org: groups, muting, custom permissions, Apex checks, tests and CLI deploys.

Reusable validation rule formulas for opportunities, a bypass switch for data loads, an Apex addError twin and tests that prove both layers.

A practical decision framework for Flow and Apex, with a lead-scoring example built both ways: a Flow that calls a bulk-safe invocable Apex action.

Build a trigger handler framework with one trigger per object, bypass switches, a per-object Custom Metadata toggle and a recursion guard.

Make REST callouts from Apex without hard-coded secrets: Named Credentials, a typed client, error mapping, delayed retries and mock-based tests.

Go beyond 75% coverage: data factories, bulk tests, callout mocks, the Stub API, permission tests and limit checks, built on a real case-escalation flow.

Choose between future methods, Queueable and Batch Apex by building one credit-score refresh three ways, with a decision table, limits and tests.

Write SOQL that scales: selective filters, bind variables, safe dynamic queries, aggregates, keyset paging and user-mode security, with a full case-search layer.

The per-transaction Apex limits you hit most, sync vs async, plus a limits-aware renewal engine that measures itself and hands work to a Queueable.