Today3 stories

The Daily Org

Spring '27Sandboxes 6 Feb 2027

Curated by Abhinav (opens in a new tab)

Vol. I · No. 43The independent daily for Salesforce admins, developers and architects3 stories

Must-readDevOps

Seven bugs that passed a 113-test Salesforce suite and the fix for each (opens in a new tab)

You will learn seven ways Apex and LWC code can pass its tests yet fail in a real org, including keyset paging, retried saves, restricted picklists and cacheable methods.

Why read this

Each comes with a concrete fix and a check you can run on your own code.

Recursion guard (bug 2)

  • Static Id set skips retried records
  • Silent skip with all-or-none off
  • Compare old and new values instead

Cacheable refresh (bug 5)

  • cacheable=true returns stale rows
  • Mocked Jest tests cannot catch it
  • Drop cacheable or use refreshApex()
The author's fixes for two of the seven bugs, set side by side

The author’s starter kit had 113 passing tests, 68 Apex and 45 Jest, and deployed cleanly to a real org. A tester clicking through the data table and a reviewer reading the code together found seven bugs that no test had caught. The gaps lay between what the tests checked and what a live org did.

The first bug was a paged table that kept showing page one. The server used a keyset cursor, and a cached browser component sent only a page number, so the server treated every request as page one. The tests called each version with the arguments it expected, so an old client against a new server was never tested. The fix is to fall back to offset paging when a later page arrives without a cursor, and to check what an old client would receive after changing an @AuraEnabled contract. The second bug was a static Id-based recursion guard that silently skipped retried records when a save ran with all-or-none off. The fix is to compare old and new values and recalculate for work that is safe to repeat, keeping an Id guard only for work that must happen exactly once.

The third bug was a logger whose Platform Event carried any LoggingLevel name, while the Log__c picklist allowed only ERROR, WARN, INFO and DEBUG. Logs finer than DEBUG failed silently in the subscriber trigger. The fix is to store anything finer as DEBUG, and to test every restricted picklist with a value outside its list. The fourth was an example Account trigger shipped switched on, which changed the data of anyone who deployed the kit. Example code should ship disabled, and the tests should enable handlers only while they run.

The fifth bug was a refresh() method that could show stale rows, because the backing Apex method was cacheable. Jest mocks cannot catch this, so it appears only in a real browser. The fix is to drop cacheable=true where current data matters, or to use @wire with refreshApex(). The sixth was a no-CLI zip, built by hand, that still held six older files. The fix is to build the zip from the source folder in one script, compare every file, and deploy the zip as the final test. The seventh was an offset calculation that overflowed for very large page numbers before the row-limit check ran. The fix is to compare before multiplying.

The author groups the bugs into gaps between versions, between code and platform, between the developer’s org and the buyer’s, and at input edges nobody types on purpose. The closing advice is that passing tests cover only what the developer thought of, so manual testing and fresh review are needed before calling code production-ready.

Read the original at dev.to (opens in a new tab)

Worth reading?

RecommendedReleases

Working around the 2,000-row cap on report exports after step-up authentication (opens in a new tab)

You will learn why scheduled report exports now fail or stop at 2,000 rows after the Summer '26 changes, and the four practical options for fixing refreshes: manual export, narrower reports, a suitable connector, or SOQL.

  1. Export manually for a one-off pull
  2. Narrow the report with filters
  3. Use a connector built for the change
  4. Move recurring extracts to SOQL
Four ways to adapt a report export that stops at 2,000 rows

From July 1, 2026, Salesforce requires step-up authentication for exporting and printing reports, even for users already signed in with MFA. Viewing or running a report does not trigger the check. Admins can configure the policy under Session Security Level Policies with a step-up period from 1 to 120 minutes. Scheduled jobs cannot complete the check, so spreadsheet and BI tools have moved to the Analytics API, which uses OAuth and does not trigger it.

The Analytics API returns at most 2,000 rows per report run, and no permission or setting raises that cap. Other limits apply too: 500 synchronous report runs per hour, 1,200 asynchronous requests per hour, 20 Custom Field filters per run, and 100 columns per report. These limits are shared across the org, so heavy scheduled refreshes can affect other processes.

The article offers four options. For a one-off need, use a Details Only export by hand. To stay under the cap, narrow the report with filters such as My or My Team’s, fewer columns or a shorter date range, and apply tighter filters in your own pull rather than editing a shared report. For recurring pulls over 2,000 rows, choose a connector that uses the Analytics API and retrieves the full report. For large, regular extracts, use SOQL, which avoids the export and API report limits, though groupings, subtotals and formulas must be rebuilt and queries should be reviewed against the report’s logic.

The article closes by advising a review of scheduled refreshes before they compete for the shared API limits. It also promotes Xappex connectors, which handle these cases, and this promotion is the source’s own commercial interest.

Read the original at Salesforce Ben (opens in a new tab)

Worth reading?

DevOps

Check what else runs on an object before shipping AI-Generated changes (opens in a new tab)

You will learn a repeatable way to list the active Flows, Validation Rules and triggers on an object using the Salesforce CLI and pandas, so a reviewer can see what a change will collide with before it ships.

  1. Export active Flows with SOQL
  2. Export active Validation Rules
  3. Export active triggers via Tooling API
  4. Filter the exports by object in pandas
  5. Attach the tables to the ticket for review
The article's method for finding existing automation on an object before shipping an AI-generated change

The article argues that an AI-drafted Flow, Apex class or Validation Rule must be checked against everything else already running on the same object. Before review, the author suggests finding that automation first, since a clean-looking change can clash with an existing rule, loop with another Flow, or overwrite a field a batch expects to be empty.

The method uses the Salesforce CLI to export active Flows with a SOQL query on FlowDefinitionView, and active Validation Rules and triggers through the Tooling API. Triggers are matched on their object, while Flows have no dedicated object field, so the author scans API name, label and description instead, which is imperfect but faster than opening every Flow. A short pandas script then filters the three exports for a chosen object such as Opportunity and produces a review agenda.

The author adds that managed package automation will also show up in these results. Managed items cannot be edited but can still fire after a change, so they belong in a separate list. The tables should be attached to the ticket so the next reviewer does not have to rerun the queries.

The piece also proposes three test cases a model often skips: a record that must be blocked with a clear message, a record that must pass even when a field arrives late, and the same change run by a non-admin user. It lists reasons to wait a day before shipping, such as a missing description, tests that check coverage rather than the business rule, or a field the model invented. The article is practical and short, and the queries are the main takeaway.

Read the original at dev.to (opens in a new tab)

Worth reading?