thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Business Platforms & EA · Advanced

User Mode Database Operations

Apex feature (WITH USER_MODE in SOQL and AccessLevel.USER_MODE in DML) that enforces the running user's sharing, CRUD and FLS.

Definition

User mode is the recommended way to enforce permissions in Apex, replacing WITH SECURITY_ENFORCED. Violations throw a QueryException or DmlException that lists inaccessible fields.

Example

List<Contact> cs = [SELECT Name, Email FROM Contact WITH USER_MODE];

Exam tip

WITH USER_MODE enforces sharing plus CRUD/FLS; WITH SECURITY_ENFORCED only checked CRUD/FLS on selected fields.

Related terms