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
Ashish P.Ashish P. 

how to edit picklist from visualforce page?

I had created a visualforce page name resolutin and has a field name status

        Status field has nine picklist option includind closed

The is a resolution controler class i had created.

 

following is the visualforce page page block section that has status field:

 

<apex:pageBlockSectionItem />

<apex:pageBlockSectionItem labelStyle="white-space:nowrap;" rendered="true">
<apex:outputLabel value="Status" for="status"/>
<apex:inputField id="status" label="Status" value="{!case.Status}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem labelStyle="white-space:nowrap;">
<apex:outputLabel value="Status Details" for="statusdetails"/>
<apex:inputField id="statusdetails" label="Status Details" value="{!case.StatusDetails__c}" required="true"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:panelGrid>
</apex:pageBlock>
<apex:pageBlock mode="maindetail">
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!resolveCase}" value="Save" rendered="{!errorCode <> 1}"/>
<apex:commandButton action="/{!case.id}" value="Cancel" immediate="true" />
</apex:pageBlockButtons>

 

AND FOLLOWING IS THE CASE CONTOLLER:

 

//---Initialize the controller
public CaseResolution (ApexPages.StandardController stdController) {
controller = stdController;
c = (Case)controller.getRecord();

if ((c.status == 'Resolved') ) {
errorCode = 1;
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Can\'t resolve the case. Case has been ' + c.status + ' already.'));
} else {
c.status = 'Resolved';
c.statusdetails__c = null;

this.level1ResCode = c.ResolutionCodeLevel1__c;
this.level2ResCode = c.ResolutionCodeLevel2__c;
this.level3ResCode = c.ResolutionCodeLevel3__c;

resultSize = 0;

 

 

sfdcFanBoysfdcFanBoy

what do you want to achieve?

Ashish P.Ashish P.
There is field on visualforce page I want to hide one pick list value of that field.