16 votes

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

You can make use the User Interface API to get picklist values based on record type, https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_picklist_values.htm However, ...
psun's user avatar
  • 371
13 votes

Get lists of dependent picklist options in Apex

Approaches had been well discussed in the above thread. Following is an apex utility function that provides the controlling field value and its dependent field values provided object name, ...
Suriya Soundrapandian's user avatar
9 votes

Get lists of dependent picklist options in Apex

I've recently come up with this concise version of the dependent picklist code. One method, self-contained, about 30 lines of code. The method returns a map of lists, keyed by controlling values, ...
Glyn Anderson's user avatar
8 votes

Picklists validFor attribute

DescribeSObjectResult describes how validFor operates. It is decoded into a series of bits (base-64 encoded) where each bit is set to 0 if not valid, 1 if it is. In your example, AAAI decodes to: ...
sfdcfox's user avatar
  • 490k
6 votes

Get lists of dependent picklist options in Apex

I have had an opportunity to check the solution from Tommy answer (http://titancronus.com/blog/2014/05/01/salesforce-acquiring-dependent-picklists-in-apex/), and while it worked for some simple ...
Andrew Stopchenko's user avatar
6 votes
Accepted

Update Dependent Picklist when created by API

So, leveraging the tooling API would be a lot of work. Simplest way: Per Adrian this may be another easy way but you would have to refactor the JS to apex: Get lists of dependent picklist options ...
Eric's user avatar
  • 54.2k
6 votes
Accepted

Does force:inputField support dependent picklists?

Oh wow, perfect timing! <force:inputField> did not even support 'standalone' picklists as of 3 days ago. Salesforce only fixed it recently. Out of curiosity, are you trying this on a Spring '17 ...
mkorman's user avatar
  • 4,046
6 votes
Accepted

Decode dependent picklist validFor mapping in Javascript

To process them, you can use the same type of code you see in the documentation. Here's how I'd write this in ES5: function testBit(bitmap, index) { // Given an 8-bit binary string, get the index / ...
sfdcfox's user avatar
  • 490k
6 votes
Accepted

Is it possible to get ui api Picklist Value Collection response body in ltgn comp js (for pcklst dependencies)

Yes you can, via the onload event of the lightning:recordEditForm (as you are currently doing), access the recordUI Object: JSON.stringify(event.getParam("recordUi")) in the console you will see ...
glls's user avatar
  • 20.1k
5 votes
Accepted

How to present state and country picklists with dependency logic in a Lightning Component?

For anyone interested, this is my mild reworking of Benj's code that works out the dependencies in Apex code. These changes are mainly aimed at performance (reducing CPU time from over a second to ...
Keith C's user avatar
  • 136k
5 votes
Accepted

Fetch dependent picklist values depending on record type

According to UI API for Salesforce: The endpoint: GET /ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName} gives you valid values for record type along with controlling ...
Pranay Jaiswal's user avatar
4 votes

Maximum values in dependent picklist

A controlling field can have up to 300 values. If a field is both a controlling field and dependent picklist, it can’t contain more than 300 values. See the docs also: https://help.salesforce.com/...
Guy Clairbois's user avatar
4 votes
Accepted

Is there any way to make a text field dependent on a picklist field?

The only fields eligible for dependency are Picklists and Checkbox fields. (Checkboxes can only be controlling, not dependent, fields). If you don't want to build custom functionality in Lightning or ...
David Reed's user avatar
  • 92.8k
4 votes
Accepted

Cannot remove global picklist after deletion picklist

The deleted picklist field is still in the system equivalent of a recycle bin (so that you can restore it if needed). In setup, go to the object where you deleted the picklist, open the custom field ...
David Cheng's user avatar
  • 7,085
4 votes
Accepted

set picklist default value

It is not currently possible. The only option you currently have is to set an initial default value for the dependent picklist on creation. This will only work assuming you also set a default on the ...
Kris Goncalves's user avatar
3 votes

Update Dependent Picklist when created by API

I would suggest these steps: Create classes as described by Neel here: Salesforce: Acquiring Dependent Picklists in Apex I'd probably alter/overload to accept Schema.SObjectField values Also a good ...
Adrian Larson's user avatar
  • 150k
3 votes

ReRendered form with wrong data on inputFields dependent picklist

I found a similar problem on the developer forums from 2008 - If immediate="true" rerender does not appear to work. The general problem was that immediate="true" wasn't well suited to scenarios where ...
Daniel Ballinger's user avatar
3 votes
Accepted

ReRendered form with wrong data on inputFields dependent picklist

Dependent picklist works fine with <apex:inputField> when you have static table. It erratically behaves with rerendering by <apex:inputField> (controlling picklist). This strange behavior ...
Santanu Boral's user avatar
3 votes

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

I've been searching to try to solve this problem my self but found that the FinancialForce library in Github only works with API version 37 and earlier so is off limits now that we are on V50 ...
NinjaFromNZ's user avatar
3 votes

Is there any other way to make Standard Picklist field as a Dependent pick list field

Check Dependent Picklist Considerations Standard versus custom picklists Custom picklist fields can be either controlling or dependent fields. Standard picklist fields can be controlling ...
Devendra's user avatar
  • 5,075
3 votes

Picklist not displaying values

This value: rerender="selectState" should be the ID of a page element of a surrounding block not just the field you want to rerender: <apex:pageblock id="pb"> ... <apex:actionSupport event=...
Keith C's user avatar
  • 136k
3 votes

Add dependency fields on opportunity page for custom object

This is pretty simple actually, we do it all the time. Each lookup field has lookup filters that allow you to limit the results of the search based on the value of fields on the object: https://help....
gNerb's user avatar
  • 9,481
3 votes

Identifying the controlling picklist of a dependent picklist

Yes, the getController() method of the DescribeFieldResult class that you linked to does just what you want. It returns a Schema.SObjectField instance, which you can call getDescribe() on to get more ...
Derek F's user avatar
  • 61.5k
3 votes
Accepted

What is the validation rule for a text field that shouldn't contain data if the correct picklist value has been selected first?

I think you mean to say and if a user selects No, the text field must NOT contain a value. OR(AND(ISPICKVAL( Any_other_liens_filed_against_you__c,"Yes"),ISBLANK( ...
salesforce-sas's user avatar
3 votes
Accepted

How to Build dependent picklists in Lightning Web Components?

Create another apex method getProducts which accepts pricebookId as parameter and returns list of products. Now in LWC js, implement wire service on that apex method which depends on dynamic property $...
salesforce-sas's user avatar
3 votes
Accepted

picklist options change depending on previous picklist

What you're describing is built-in functionality via Dependent Picklists. To use the terminology in the documentation, Picklist 1 would be your controlling field, and Picklist 2 would be your ...
David Reed's user avatar
  • 92.8k
3 votes
Accepted

Get dependent picklist name from controller picklist name using APEX

One field may control multiple fields, so you can't just call a method that returns the "single" field that's being controlled. You could do something like this: Map<sObjectField, List<...
sfdcfox's user avatar
  • 490k
3 votes
Accepted

Validation Rule Error: Missing ')'

The issue, is that second parameter of ISPICKVAL function should be a String, not Boolean, which is in your case. AND( OR( ISPICKVAL(Scenario__c, "In-Progress"), ...
Oleksandr Berehovskyi's user avatar
3 votes
Accepted

What is the best way of dealing with multi-tier dependent picklists?

A far easier approach for you here may be to instead represent these selections via data. You can create an object for each level, and then lookups to each. You can use Lookup Filters to make sure you ...
Adrian Larson's user avatar
  • 150k

Only top scored, non community-wiki answers of a minimum length are eligible