+ Start a Discussion

How to make picklist field read only?


I want to make picklist field read only. There is no permission set. I make it read only from page layout, Field level security and profile too. Still its read only. What will be another option to make it rad only?

Thanks & Reagrds,
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Utkarsha Patil,

Visualforce Page:
<apex:page standardController="Account" extensions="AccountExtensionController">
                <apex:inputField value="{!acc.Name}"/>
                <apex:inputField value="{!acc.AccountSource}" rendered="{!NOT(isSaved)}"/>
                <apex:outputField value="{!acc.AccountSource}" rendered="{!isSaved}"/>
                <apex:commandButton value="Save" action="{!save}"/>

Controller Extension:
public class AccountExtensionController {

    public Account acc {get; set;}
    public Boolean isSaved {get; set;}
    public AccountExtensionController(ApexPages.StandardController controller) {
        acc = (Account) controller.getRecord();
        isSaved = false;

    public PageReference save() {
        insert acc;
        isSaved = true;
        return null;

I hope it will be helpful.

Please mark it as best answer if the information is informative.

Rahul Kumar
Hi rahul,

I am not doing it on VF page.

Thanks & Best Regards,
Actually i am having approval process which checks one of the value in this picklist field.
For Eg. If Approval Status = Awaiting for approval then it fires an approval process.
I am doing it on quote object. When quote line item and discount changes then i update Approval Status field = "Awaiting for approval". So i need to change this picklist field using trigger thus i can not use ischange(field) validation rule
Ahmad J. KoubeissyAhmad J. Koubeissy
why you dont just make it read only on the layout, and you will be able to change it in the trigger. you can use the ischanged. what is the problem exactly ?
Hi Ahmad,

I make it read only from page layout, field level security and owd. Still its editable. Now, i have removed it from page layout and created one formula filed which displays picklist value based on the criteria in trigger and workflow rules.

Thanks & Regards,