Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
9 votes
2 answers
2k views

Executing SOQL with User Mode and then DML with user Mode causing Exception

I couldn't find if SOQL and DML become interlinked when using WITH USER_MODE with SOQL and DML both in single transaction. I've below sample code to be triggered on a button from an LWC: @AuraEnabled ...
VarunC's user avatar
  • 6,040
8 votes
3 answers
2k views

With USER_MODE - do we still need SOQL and DML libs?

As the Security model of Apex was leaky in the past, everybody who took - or as AppExchange Partners had to take - Security seriously was building or using libraries to enforce CRUD/FLS rules. The ...
Robert Sösemann's user avatar
4 votes
1 answer
231 views

Is the User Mode approach to object and field security acceptable in a security review?

This Enforce User Mode for Database Operations looks by far the cleanest approach to implement the object and field-level security that is required to pass a Salesforce AppExchange Security Review. (...
Keith C's user avatar
  • 137k
2 votes
0 answers
134 views

Salesforce code analyzer returns issue when using "as user" with dml

When I use delete with 'as user' and run sf code analyzer i get this problem: "PMDException: Error while parsing E:\testpro\force-app\main\default\classes\TestCl.cls Caused by: net.sourceforge....
Nazar's user avatar
  • 45
1 vote
2 answers
82 views

Issue with attempting update to System.AccessLevel.USER_MODE -- Cannot specify both an external ID reference Owner and a salesforce id, OwnerId: []

I'm trying some of the new features to Apex to automatically apply User Access. I cannot get an update to work that worked from with a require "update" or "Database.update()". ...
Ken's user avatar
  • 587