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
Alan AshbaughAlan Ashbaugh 

How to change the default label from "--None--" when emitting a picklist?

I am using this Visualforce code to emit a pick list: <apex:inputField id="platform_input" value="{!caseObj.Platform__c}" required="true" />

My issue is that the first item in the list is: <option value="">--None--</option>

How can I change the label for that item to something else, like "Select a product".

Note: I would want to replace "--None--" in several other pick-lists as well with pick list specific messages such as "Select an issue", "Select a platform", etc.

Thanks!
Alan AshbaughAlan Ashbaugh
Hi Anoop,

We were originally using a Schema, I believe. Here's what we had: 
// Product select
    public List<SelectOption> getProductListItems()
    {
        // get the list of options
        List<SelectOption> options = this.getPickListItems(Case.Product__c.getDescribe());

        // insert the placeholder option
        options.add(0, new SelectOption('', Label.fb_contact_placeholder_product));

        // return the list of select options
        return options;
    }

We changed to emiting the picklist automatically so we can use Translation Workbench for translating the picklist values. When we did the Schema, the value and the label were the same. The changes we made in translation workbench (such as translating a word to Spanish or German), was not output. Just the value was output.

Any thoughts?

Thanks,
Alan

Anoop yadavAnoop yadav
Hi Alan,

It is a known issue, Kindly check the below kink.

https://success.salesforce.com/issues_view?id=a1p30000000SvOnAAK
Alan AshbaughAlan Ashbaugh
Hi Anoop. I checked out the issue link you sent, but it's not what we're experience. It's not the picklist values themselves. Those are being output and translated just fine. It's the default value "--None--" which is NOT a picklist value. that we added It is generated automatically by SFDC. The "--None--" is what we need to localize and customize. What do you think?