Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
7 votes
Accepted

WITH SECURITY_ENFORCED and Security.stripInaccessible in a single SOQL

You don't need both. If you use WITH SECURITY_ENFORCED, you'll get an exception thrown if any fields are not readable by the user, while with Security.stripInaccessible, you'll simply remove any ...
sfdcfox's user avatar
  • 494k
5 votes
Accepted

Why is stripInaccessible Removing Fields in Tests

Tests still run under a user, the one under which you ran the tests. It is just that you would normally be logged in as an admin-like user. Even admins, especially on scratch orgs, need to be given ...
Phil W's user avatar
  • 36.7k
3 votes

Why is stripInaccessible Removing Fields in Tests

Apex always has access to all fields. System/user mode doesn't change that fact. This means that you can write a method like this: @AuraEnabled public static String getAccountStatus(Id recordId) { ...
sfdcfox's user avatar
  • 494k
1 vote
Accepted

StripInaccessible not removing fields

System Administrator Profile comes with Modify All Data Checked hardcoded in the profile. This overrides the field level security settings: "View All" and "Modify All" ...
gale-force-wizard's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible