Soql For View And For Reference

Use when a SOQL query that serves a custom record-viewing surface (custom LWC/Aura/Visualforce page, mobile app, or API client) must make the retrieved records show up in the user's Recent Items and global-search auto-complete by writing LastViewedDate / LastReferencedDate and a RecentlyViewed row via the optional FOR VIEW / FOR REFERENCE clauses. Covers which clause to pick, correct grammar placement, the misuse warning, the RecentlyViewed 90-day / 200-per-object lifecycle, and the custom-object custom-tab prerequisite. Standard Lightning record pages already write recency for you. NOT for FOR UPDATE row locking — use apex/record-locking-and-contention. NOT for scoping a query to Mine / Team / Territory — use apex/soql-using-scope-clause.

PranavNagrecha a28654f 7 files · 41.7 KB Updated 15 repo stars

File contents

PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/apex/soql-for-view-and-for-reference commit a28654f7a5

Frequently asked questions

npx skillmds add pranavnagrecha/soql-for-view-and-for-reference