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
sfdc_newbie17sfdc_newbie17 

Picklist on VF page not updating

Hi all
I have a VF page with a custom picklist. I have just added an option to the picklist but this is not appearing on the VF page.

Any idea what could be causing this?
Tiago Armando CoelhoTiago Armando Coelho
Can you please post the code ? Are you using cache in the visualforcepage ?
sfdc_newbie17sfdc_newbie17
<apex:page controller="CreateCaseController">//
    <style>
        #contentLoading{
            width: 100%;
            height: 100%;
            top: 0px;
            left: 0px;
            position: fixed;
            display: block;
            opacity: 0.7;
            background-color: #fff;
            z-index: 10001;
            text-align: center;
        }
        
        #contentLoading1{
            position: absolute;
            top:300px;
            z-index: 10000;
        }
        .column{
            min-width: 219px;
        }
        .column1{
            min-width: 117px;
        }
    </style>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    <script>
        /** Function for loading image **/
        function loading(val) {
            if (val) {
                document.getElementById('contentLoading').style.display = 'inline-block';
            }
            else {
                document.getElementById('contentLoading').style.display = 'none';
            }
        }
        
        function ShowColumns(ProdVal,rowNum){
            if(ProdVal != ''){
                $(".Prod"+rowNum).css("display", "table-cell");
                $(".Quantity"+rowNum).css("display", "table-cell");
                $(".Notes"+rowNum).css("display", "table-cell");
            }
            else{
                $(".Prod"+rowNum).css("display", "none");
                $(".Quantity"+rowNum).css("display", "none");
                $(".Notes"+rowNum).css("display", "none");
            }
        }
        function JsCancel(IsCont,CId,LId){
            //console.log(' ===== '+IsCont+' === '+CId+' === '+LId);
            if(IsCont == 'true'){
                window.top.location = '/'+CId;
            }
            else{
                window.top.location = '/'+LId;
            }
        }
    </script>
    <apex:form >
        <apex:pageMessages id="msgs"></apex:pageMessages>
        
        <!-- Action Status -->
        <apex:actionStatus id="loading" onstart="loading(true)" onstop="loading(false)" />
        <div id="contentLoading" style="display:none; ">
            <img id="contentLoading1" src="/img/loading32.gif" alt="Loading graphic" />
        </div>
        
        <apex:pageBlock mode="edit" title="Case Edit">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" status="loading" reRender="msgs" oncomplete="return false;"/>
                <apex:commandButton value="Cancel" status="loading" reRender="" oncomplete="JsCancel('{!IsCont}','{!ContId}','{!LId}');return false;"/>
            </apex:pageBlockButtons>
            
            <apex:pageBlockSection title="Case Information" columns="2" rendered="{!IsCont}">
                <apex:repeat value="{!$ObjectType.Case.fieldsets.Contact_Fields}" var="fieldValue">
                    <apex:Inputfield value="{!CaseObj[fieldValue]}" required="{!CONTAINS(ReqFields,fieldValue)}"/>
                </apex:repeat>
            </apex:pageBlockSection>
            
            <apex:pageBlockSection title="Case Information" columns="2" rendered="{!!IsCont}">
                <apex:repeat value="{!$ObjectType.Case.fieldsets.Lead_Fields}" var="fieldValue">
                    <apex:inputField value="{!CaseObj[fieldValue]}" required="{!CONTAINS(ReqFields,fieldValue)}"/>
                </apex:repeat>
            </apex:pageBlockSection>
            
            <apex:pageBlockSection title="Select Products" columns="1">
                
            </apex:pageBlockSection>
            
            <apex:actionRegion >
                <apex:outputPanel id="Prods">
                    <table width="80%" style="margin-left: 60px;">
                        <tr>
                            <th style="min-width: 35px;">Row</th>
                            <th>Product</th>
                            <th class="column1">Sample Size</th>
                            <th class="column">Quantity</th>
                            <th class="column">Notes</th>
                        </tr>
                        <apex:repeat value="{!ProdList}" var="P">
                            <tr>
                                <td><apex:outputText value="{!P.RowNum}"/></td>
                                <td><apex:inputField value="{!P.SL.Product__c}" onchange="ShowColumns(this.value,'{!P.RowNum}');"/></td>
                                <td class="Prod{!P.RowNum}" style="display:{!If(P.SL.Product__c != '','table-cell','none')};"><apex:inputField required="true" value="{!P.SL.Sample_Size__c}"/></td>
                                <td class="Quantity{!P.RowNum}" style="display:{!If(P.SL.Product__c != '','table-cell','none')};"><apex:inputField value="{!P.SL.Quantity__c}"/></td>
                                <td class="Notes{!P.RowNum}" style="display:{!If(P.SL.Product__c != '','table-cell','none')};"><apex:inputField value="{!P.SL.Notes__c}"/></td>
                            </tr>
                        </apex:repeat>
                        
                        <tr>
                            <td colspan="4">
                                <apex:commandButton value="Add Row" action="{!AddRow}" status="loading" reRender="Prods,msgs" oncomplete="return false;"/>
                            </td>
                        </tr>
                    </table>
                </apex:outputPanel>
            </apex:actionRegion>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Tiago Armando CoelhoTiago Armando Coelho
Hi, 

Can you please identify what is the field that isn't displaying? 

Kind regards,
 
sfdc_newbie17sfdc_newbie17
The filed on the case is called 'Hook'. The picklist appears, it's just the new value i've added hasn't
Tiago Armando CoelhoTiago Armando Coelho
Please share a printscreen on the Hook picklist setting with the indication about what values aren't being displayed.
sfdc_newbie17sfdc_newbie17
The option not appearing is "Direct". If I create a case without using VF page, the option is present, just the not when using VF page

Thanks,

Hook picklist optionsHook option on VF page
 
Tiago Armando CoelhoTiago Armando Coelho
Hi

Please check that in your record type you have the values.
Setup -> Cases -> Record Types -> Select your picklist and check the values available.

Kind regards, 

 
sfdc_newbie17sfdc_newbie17
The picklist value is available to the record type, hence why is work when not using the VF page
sfdc_newbie17sfdc_newbie17
Anyone got any other suggestions?

I've even tried this in sandbox with the same issue, I have added another option which we need but it doesn't appear on the visual force page