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
wpatterswpatters 

Packaging read-only fields

Hello everybody, I was wondering if there are any special steps that must be taken when including a read only field in a package.  I have uploaded my package a few times, and each time when I test it out, it makes my read only fields into regular read/write fields.  How do I keep them as read only fields? Thanks
shillyershillyer

The read-only attribute is tied to the profile or the page layout. So one question, are you packaging the custom profile too? And when you test it out, are you testing with a user that is part of the profile with read-only permissions? Keep in mind - if you are logged in as an admin, you can modify read-only fields. If you are installing into a PE org, there are no custom profiles, so this won't apply.

Another question - are the read-only fields on a Standard or Custom object? I ask because this affects the page layout solution. You can make the field read-only on the page layout. However, if this is a standard object, you cannot package the custom page layout. Whereas if this is a custom object, you can.

Best,

Sati

wpatterswpatters
Thanks for the response.  It's a custom object, and the fields should be read-only for EVERYONE regardless of profile, including admins.


Message Edited by wpatters on 10-29-2008 11:33 AM
shillyershillyer

You would then need to create a custom profile (and include that in the package) that has "Modify All Data" disabled. Then you can ensure no has access to write to that field.

Best,

Sati