Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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
add comment

2 Answers 2

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 http://wiki.developerforce.com/page/Enforcing_CRUD_and_FLS

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.