1

On HTML it is possible to have a different value than what the end-user sees. For example:

<option value="0.08">8 %</option>

Is there any way to accomplish this same idea with the default salesforce features?

1
  • What do you mean by default salesforce features?
    – Saroj Bera
    Jul 1, 2016 at 8:47

2 Answers 2

3

Yes it is possible. What you need to do is:

  • define your picklist values (eg. 001,002,003 and so on)
  • translate values in the Translation workbench or just give a standard (master) label for it

You will then get exactly what you want: values are defined in the picklist and labels are translations:

<option value="picklist value"> translation </option>

This is a standard salesforce feature that is easy to configure and deploy.

0

In Visualforce there is component apex:selectList https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm

It's child element <apex:selectOptions> is referenced to List<SelectOption> in controller. SelectOption is class that contains label and value. Label id displayed for user, value is used in backend.

Or you can use single Visualforce elements <apex:selectOption itemValue="red" itemLabel="Red"> https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectOption.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .