Skip to main content
Hi - I came across a custom text field today (on Opportunity) that a user wanted to edit but can't. On investigating this field is set read-only for all the profiles and the field level, and I can't see any overrides for this in any permission sets.  So no mystery so far - it's read only and so you can't edit it on any layout.

 

However this field can get set via apex code when creating the object. The apex coppies a number of fields from the Contact to the Opportunity on opportunity creation. This seems to set this custom field.  Is it expected that apex can set a read-only field on object creation? Or am i correct in assuming I'm missing something.

 

 
6 answers
  1. May 28, 2015, 9:38 AM
    Hi Nigel,

     

    Is the Apex class defined as 'without sharing' ?
0/9000