function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mani kadimi 13mani kadimi 13 

What will automatically obey the organization-wide defaults and sharing settings for the user who executes the code in the salesforce organization? A. Apex Triggers B. HTTP Callouts C. Apex Controllers D. Anonymous Blocks

NagendraNagendra (Salesforce Developers) 
Hi Mani,

The answer is Anonymous Blocks. With the choices that are available, it can be confusing if this is the option or Apex Trigger. Apex Trigger can be used in order to compile data and execute everything that is needed. Apex Trigger can be used in system mode but it is only Anonymous Blocks that can help get user permissions.

Remember that you cannot use Apex Triggers if you want to update a field if you would not be able to use it. You cannot use the other codes that are given to you. The Apex code can get stuck in the metadata but it can be executed when needed.

Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra