Find your content:

Search form

You are here

How to make Lead Status field read-only in a profile?

 
Share

I'm trying to set up a profile that can only change the Owner on a Lead, nothing else.

Mostly it works, except for three fields: Name, Lead Status and Company:

  • Field-level security won't let me set these to read-only (settings are not editable)
  • Can't make them read-only in page layout either (options are greyed out, with 'Required' checked and 'Read-only' unchecked)

In the Field Accessibility page the fields show as Editable with the explanation 'Field is editable because of page layout'.

Is there any way short of validation rules to make these fields not editable for a given profile?


Attribution to: Jelle van Geuns

Possible Suggestion/Solution #1

I know you said no validation rules in your question, but based on your comments it seems like it's more of the aesthetics that's keeping you away from them. From personal experience, as long as you have a good error explanation that doesn't leave users confused, they have no problem with validation rules. In case you decide to go this route, here's a rule that may work for you.

AND($Profile.Name = 'Read-Only Profile', ISCHANGED(Lead_Status))

Error Message: Lead Status is a read-only field for users with the profile 'Read-Only Profile'

Hope this helps if you decide to use this.


Attribution to: jackerman09

Possible Suggestion/Solution #2

Check out this link : http://salesforce-stuff.blogspot.com/2011/10/removing-save-new-button-and-other.html

The link shows in detail how to hide a field from the edit mode. Hopefully you can refactor the JS var x=document.getElementsByName("email");(assuming email field or get Id of the field from view source and getElementById) x.readonly = true;

I have not tested this but know siderow hack is an option


Attribution to: Rao

Possible Suggestion/Solution #3

Using Visualforce, you can replace the default Edit page with your own page. For those fields, make sure that they are rendered as outputfield for the Profile in question:

<apex:outputfield value="{!Lead.Company}" rendered="{!($Profile.Name == 'Limited Profile Name')}" />
<apex:inputfield value="{!Lead.Company}" rendered="{!($Profile.Name != 'Limited Profile Name')}" />

For this purpose, you don't need any Apex, just a page.


Attribution to: Jeremy Nottingham
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1659

My Block Status

My Block Content