Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can an apex code, invoked by a non-admin user, perform an update on a field that has a field-level security of visible and read-only for non-admin profiles?

If so, what is permitted/restricted by the above field-level security?

share|improve this question

The edit access to the record is determined by the sharing access granted to the user, unless you declare the apex class as without sharing.

Apex executes in system mode so it would override FLS and be able to write to the field.

The FLS Read Only will apply to a user having the said Profile editing the record via the UI

share|improve this answer

Apex generally runs in system context; that is, the current user's permissions, field-level security, and sharing rules aren’t taken into account during code execution.​

For more detail you can visit this link

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.