Questions tagged [picklist]

A picklist is a field type in Salesforce that contains a list of values from which a user may select a value. A picklist is represented as a drop-down box in the UI.

Filter by
Sorted by
Tagged with
40
votes
5answers
7k views

How do I get the intersection of RecordType and Picklist values inside Apex?

Context This question has been asked before in the past and I've found several discussions of it here on StackExchange and elsewhere (links below to pages I've found in my research). So far I'm not ...
22
votes
2answers
9k views

Converting an Existing Picklist to Use Global Picklist

Is there a way to convert or update an existing custom picklist to use a global picklist without deleting and recreating it? As most will be aware this cannot be done easily if the field is referenced ...
21
votes
2answers
55k views

how to get a picklist all values in apex controller

I have a Student object and have a pick list field "Student Status" in this object. Status can be Full-Time OR Part Time. Now my requirement is i want this student status list, Part-Time or Full-Time ...
16
votes
2answers
33k views

How to query 'Value' of a picklist rather than the 'API NAME', using SOQL?

I am using SOQL to query the opportunity. When I use the query, SELECT CUSTOM_PICK_LIST_COL__C FROM OPPORTUNITY I am getting the values under the API Name of the picklist items. How to get the value ...
14
votes
1answer
2k views

Why is State and Country a text input in Visualforce when I have State/Country picklists enabled?

Are State and Country Picklist supported in Visualforce? I'm trying to access them on Visualforce for Contact object but only a Textbox is displayed instead of a Dropdown. My code is: <apex:page ...
14
votes
5answers
4k views

What are the best practices for managing changing picklist values in managed packages?

One of the issues that we always see when creating new releases of our managed package is that new or changed picklist values don't deploy when someone upgrades our app using a new release that we ...
14
votes
2answers
9k views

Picklist Values in Dynamic Lightning Components

Is there an out-of-the-box solution to populate record-type specific picklist values when creating a picklist dynamically (in a Lightning Component) that references an sObject field? At this point ...
14
votes
2answers
6k views

Mass Delete Picklist values

I'm trying to find an automated way to mass delete picklist values. I had a look at the following ways to accomplish this but without success: Force.com IDE: Deleting the picklist values in the ...
13
votes
3answers
3k views

Is there a way to group options in a selectList

Is there a way to group options in an apex:selectList I have in my page <apex:selectList styleclass="form-control rec" size="1" id="country" > <apex:selectOption ...
13
votes
1answer
309 views

Massive Spring '17 bug: SOQL returns wrong Custom Metadata Type picklist value

Based on all evidence gathered there is a major bug in Spring '17 involving Custom Metadata Types and picklist values: what SOQL returns is different than what's saved in the database. To reenact: ...
11
votes
2answers
4k views

Are dependent picklists supported in Lightning Components?

It's possible to define dependent picklist in the setup and the are supported out-of-the-box in Visualforce. Are they also supported in Lightning natively? Is it on the roadmap to support them soon? ...
11
votes
3answers
5k views

Lightning - retrieve picklist values available for RecordType

How can I show only picklist values allowed for a specific Record Type? For example: Case.Status values are "Pending", "Open", "Closed" Case RecordType1 only allows the Pending value Case ...
11
votes
1answer
2k views

Prepopulating multiselect picklists in a flow

I have a multiselect picklist on a record. I want to display its current values in a multiselect picklist in a visual flow. But when I tried setting the value of the picklist to a variable and setting ...
10
votes
2answers
11k views

Retrieve globalpicklist/globalvalueset without SOQL

Is it possible to retrieve the values of a Global Picklist/GlobalValueSet using Schema class without a SOQL ?
10
votes
2answers
9k views

Access to State and Country Picklist values through Apex or API?

I recognize that State and Country Picklists are still a "Beta" feature, but does anyone know if, in Summer 13, its possible to get at the State and Country Picklist Values through either the Apex ...
10
votes
1answer
2k views

How to write Address.settings in order to implement Country Picklists via Metadata API (eclipse)?

In order to implement Country Picklists on standard address fields I'm following the documentation here: https://help.salesforce.com/HTViewHelpDoc?id=admin_state_country_picklists_overview.htm&...
10
votes
1answer
1k views

State & Country picklists - importing leads with states for countries without states enabled

Tell me that I'm wrong but it would appear the State and Country picklist feature makes it impossible to integrate / import Leads with state values from countries where you are indifferent to the data ...
9
votes
2answers
9k views

Custom setting Setting type not visible

I am trying to create a new custom setting in salesforce but the Setting Type field is greyed out and fixed to Hierarchy. What could be the possible problem?
9
votes
2answers
2k views

Metadata API error while reading Picklist: Web service callout failed: Unable to find apex schema info

I am trying to read a custom dependent picklist field and update it's field-dependencies. I have followed the common resources found online and getting the below error: FATAL_ERROR System....
9
votes
1answer
8k views

Dependent multi-select pick lists

I'd like to add 3 picklist fields to an Account object in the following manner: Parent multi-select Picklist field (let's call it ParentMultiSelectField__c) A dependent mutli-select Picklist ...
9
votes
2answers
6k views

Error: Cannot modify managed object

I have a picklist field in an object with a controlling field and it is uploaded successfully. But when I changed it's controlling field to an another value the uploading gave an error saying :- ...
9
votes
6answers
8k views

Dependent picklists - Controlling field not on the page layout

I want to be able to have the controlling field of a dependent picklist not show to the users, I am updating this field using workflow. From Salesforce docs Page layouts Make sure controlling fields ...
9
votes
1answer
884 views

Picklists not Supported in SOQL WHERE Clause (External Objects)

Background I ran a SOQL query from the developer console on one of my external objects which has a picklist field (Object name Fixture__x, picklist field name Status__c). The following query: ...
8
votes
1answer
7k views

Picklist API name in Formulas

In Spring '17 I am trying to use picklist value API name in a formula. How can I access a picklist value API name in a formula like ISPICKVAL?
8
votes
1answer
6k views

Picklist value translation

I have am email body I'm generating in APEX and I want it to include the translated value of a picklist. How can I get the translated value in APEX?
8
votes
1answer
4k views

Deploying standard picklists via Metadata API

Have some trouble deploying leadSource and Industry picklists via Metadata API. Had to comment out both of them from the build. It may have something to do with these picklists being shared by ...
8
votes
2answers
2k views

How to Find the Count of Multi-Select Picklist?

I was searching for a method to find the count of selected multi-select picklist. My aim is to select multiple options for Known-Languages in a Drop down and to display the selected count in a Counter ...
8
votes
1answer
845 views

How do I go about updating Pat Patterson's Multiselect Picklist Visualforce Component for API > 26?

Pat Patterson's Multiselect Picklist component is exactly what I need for a page I am working on, and works great with API version 26. However, when I try to use it with a more current API version (...
8
votes
5answers
3k views

Picklist value available for selection on change of record type

There is a custom object "XYZ" which has a picklist field "F1" with values 1, 2, 3, 11, 12, 13. There are two record types "A" and "B". For A, F1 has 1,2,3 set and for B, F1 has 11, 12, 13 set. User A ...
8
votes
1answer
321 views

Is there a way to automate the deployment of changed picklist values in a pipeline using SalesforceDX?

Sometimes we need to change the label or, more commonly, a value for a picklist item. Suppose we do change the fullName attribute of a picklist field, to match an external system that will integrate ...
8
votes
0answers
5k views

SFDX Deploy: Global Value Set Cannot Be Resolved

I am trying to use DX to deploy to a sandbox. It has been a major hassle. At this point the only error I get is this: Global value set 'External_Evaluation_Required__c' in record type 'Exception' ...
7
votes
7answers
5k views

Multiselect Picklists with many values

Note: Though this is still of use in extreme cases, the limit on multi-select picklist values has been raised to 500 values in Winter '16. Also, the Global Picklists feature, which is currently (...
7
votes
2answers
17k views

Using Custom Labels in a Class

I have the below If statements using some hard coded strings and I want to make them use as custom labels. I have created custom labels with the same String names as given below. So how can I make ...
7
votes
2answers
7k views

Metadata API : How to get the translated values of picklists of my object

Wanna get the translated values of picklists of my object? How can I get them in Apex. I tried using Metadata APi but invain. Can anyone suggest me?
7
votes
1answer
1k views

How can I query the supported timezones in Apex?

Apex provides a TimeZone API. You can use this to query the detail of a time zone, named using its "SID" (a value like "Europe/London" or "America/New_York" for example). However, this API doesn't ...
7
votes
4answers
699 views

Options for universal pick lists?

Is there any strategy for implementing global lookup lists (universal pick lists) ? There is a long standing request (for 7 years) for this, and it is something that I am used to having in Dynamics ...
7
votes
1answer
12k views

When is it appropriate to use Record Types?

The documentation for Record Types states: Record types allow you to offer different business processes, picklist values, and page layouts to different users. It seems to me that unless you are ...
7
votes
1answer
417 views

Is it possible to add a controlling field to an existing picklist on a custom object as part of a managed package upgrade?

I have an existing picklist on an existing custom object in a managed package. This package is already deployed and installed by users. For the next release of my package, I have added a checkbox ("...
7
votes
0answers
895 views

Populate Record Choice Set from a Record Collection Variable

I am creating a lightning flow & trying to create an input with dynamic choices. On the basis of some decisions I am using get Records with different filter criteria to get records & using ...
7
votes
1answer
5k views

Dynamic Picklist Values by RecordTypes? [duplicate]

I've searched high and low and can't seem to find any posts or blogs showing how to get picklist values for a particular recordType to use in a custom controller. I can easily obtain the RecordType ...
6
votes
3answers
555 views

Get list of unused picklist options

I have a custom object with a picklist field with a very large number of options. In an effort to reduce the number of choices, I want to find (and remove) all the options in this picklist which are ...
6
votes
3answers
2k views

How to support State and Country picklists from same code that supports picklists disabled?

It would seem that it is not possible to support picklists enabled and picklists not enabled from the same Apex Code if we are writing to the State or Country. Consider the following: oAccount[0]...
6
votes
4answers
11k views

How can I add a new value to a picklist using APEX?

I have queries pulling all of the information correctly but what I can't seem to find was a way to add new options to a picklist using APEX. I currently have Package__c.Products__c.add(new Schema....
6
votes
3answers
971 views

Enforcing Order of Execution (stage progression) in picklist

How to force the order of execution(selection) of the picklist values in salesforce.Is there any other way other than validation rules in visualforce page. Lets say I have 4 picklist values (Draft,...
6
votes
2answers
7k views

How to render VisualForce components based on default values

I am trying to render one component based on whether another one has a specific value set on a Visualforce page. Using the following, it works fine EXCEPT on the initial load (i.e. once I start ...
6
votes
1answer
2k views

Get picklist values in apex in the order they were entered

I want to get the picklist values of a picklist field in Apex. I use the someFieldResult.getPicklistValues(); function and that works fine. This gives me all the picklist values, in alphabetic order (...
6
votes
2answers
2k views

Text field to Picklist

Is it possible to push the value of a text field into a picklist without using a trigger in salesforce?
6
votes
4answers
10k views

Setting Default picklist value on loading of Visualforce page

I have designed a VF page to create a new record in which I am trying to display the value of a pick-list field. I have set a default value for this pick-list field. When trying to create the record ...
6
votes
2answers
267 views

Creating a centralized place for picklist

I would like to get a suggestion on centralizing pickilst values. In salesforce, we need to define picklist values in each object for same kind of fields. For example, i want to add 'status' field in ...
6
votes
1answer
2k views

Pick list as an inline editor

I am creating a VF page and want to show a custom pick list created dynamically in my controller as an inline editor for a custom value. Both the value and list are custom properties of my controller ...

1
2 3 4 5
19