Spring 23 enhancements and new features for the Spring 23 release of Salesforce. Presented at the London Salesforce Developers Trailblazer group meetup in April 2023.
:( Cannot use in for:each or iterator LWC1158: Invalid lwc:ref usage on element "<li>". lwc:ref cannot be used inside for:each or an iterator. Can have multiple elements with identical references <div lwc:ref="userInfo"> … </div> <span lwc:ref="userInfo">… </span> ← Winner!
provide a reference • Hygiene - refs do not appear in rendered HTML • Performance ◦ this.refs built once by the platform ◦ Not evaluating selector across all objects LWC References
of class sharing keywords) • Field Level Security • Object Permissions Use over WITH SECURITY ENFORCED • Handles polymorphic fields (Owner, TaskId) • Applies to all clauses (including WHERE) • Finds all errors in query (security enforced only returns first) User Mode Database Operations GA
contacts=[select id, FirstName from Contact WITH SYSTEM_MODE]; ... insert as system acc; Cannot elevate to system mode where user mode enforced • Anonymous Apex
supports bind variables. • Fields from sObjects • Results from method calls • Static variables Map acctBinds = new Map{'acctName' => new AccountService().defaultAccountName}; List accts = Database.queryWithBinds('SELECT Id FROM Account WHERE Name = :acctName', acctBinds, AccessLevel.USER_MODE); SOQL Query with Bind Variable Map