#1MinuteTip Came across this tweet on user Mode Database Operations in Salesforce Apex presented in TrailblazerDX 2022 (#TDX22).
I cannot remember when Salesforce ever released something so fundamental, that will make every developer's life SOOOO much easier than before. @ca_peterson and team. Thank YOU. https://t.co/nhLLMxJR42 pic.twitter.com/ZNKLH0Cu0D
— Robert Sösemann (@rsoesemann) April 28, 2022
Now there is a new way to enforce user level security in your Apex code with syntax like:
INSERT AS USER new Account(Name = 'GenWatt Throwback') ;
Account a = [SELECT Id, Name FROM Account
WHERE Support__c = 'Premier' WITH USER_MODE] ;
a.Rating = 'Hot' ;
UPDATE AS SYSTEM a
You can view/download the full presentation from this URL.