I have picklist value.I have used dynamic picklist for this.I disabled it for some profile.When I create/edit/save for the profile users those can edit this field is coming good.The record getting savedc correctly.But when I am trying to edit the record from the user those can only see the disabled profile.Whatever value i have save only default value is coming.Please help.
//class
public String selectedValue {get;set;}
public List<SelectOption> getvalue()
{
List<SelectOption> options = new List<SelectOption>();
Schema.DescribeFieldResult fieldResult =object__c.Field__c.getDescribe();
List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
for( Schema.PicklistEntry f : ple)
{
options.add(new SelectOption(f.getLabel(), f.getValue()));
}
return options;
}
public pagereference saveRecord(){
..............
obj.TradeAreaSuperNm__c=selectedValue;
insert obj;
}
//vf page
<apex:pageBlockSectionItem >
<apex:outputLabel value="picklist"/>
<apex:selectList id="countries" value="{!selectedValue}" disabled="{!$profile='custom profile'}" size="1" multiselect="false">
<apex:selectOptions value="{!value}"/>
</apex:selectList>
</apex:pageBlockSectionItem>