For Salesforce developers, working with picklist values has always been straightforward until record types came into the picture. While Apex could easily retrieve all active picklist values using Schema Describe methods, it couldn’t determine which values were actually available for a specific record type. As a result, developers often had to rely on UI API callouts, custom wrapper classes, or Lightning Data Service to fetch record type-specific picklist values.
With Salesforce Spring ’26, this long-standing limitation has finally been addressed. Salesforce has introduced a native Apex API that allows developers to retrieve picklist values for a specific record type directly from Apex, making development simpler, cleaner, and more efficient.
The Challenge Before Spring ’26
Imagine an organization with two Opportunity record types:
- Retail
- Enterprise
The Stage picklist might contain different values for each record type.
Retail
- Prospect
- Negotiation
- Closed Won
Enterprise
- Discovery
- Proposal
- Contract Review
Previously, using the following Apex code:
Schema.DescribeFieldResult describeResult=Opportunity.StageName.getDescribe();
List<Schema.PicklistEntry> values = describeResult.getPicklistValues();
would return every active picklist value, regardless of the selected record type.
This meant developers had to:
- Build UI API callouts from Apex
- Parse JSON responses
- Create reusable wrapper classes
- Maintain additional code just to retrieve the correct picklist values
While these workarounds solved the problem, they increased complexity and made applications harder to maintain.
What’s New in Spring ’26?
Salesforce has introduced a new Apex method that returns picklist values based on a specific record type.
recordTypeId = Schema.SObjectType.Account
.getRecordTypeInfosByDeveloperName()
.get('Business_Account')
.getRecordTypeId();
ConnectApi.PicklistValuesCollection result =
ConnectApi.RecordUi.getPicklistValuesByRecordType(
'Account',
recordTypeId
);
With just a single method call, developers can now retrieve all picklist fields and their values exactly as configured for the specified record type.
- No HTTP callouts.
- No JSON parsing.
- No custom utility classes.
Accessing Values for a Specific Field
Suppose you want to retrieve the Rating picklist values for the selected record type.
ConnectApi.PicklistFieldValues ratingValues = result.picklistFieldValues.get('Rating');
for (ConnectApi.PicklistValue value : ratingValues.values) {
System.debug(value.label);
System.debug(value.value);
}
Example Output:
Hot
Warm
Cold
Only the values assigned to the specified record type are returned.
Support for Dependent Picklists
Another major advantage of this enhancement is support for dependent picklists.
Consider the following relationship:
Country
↓
State
↓
City
In earlier releases, retrieving dependency mappings required additional API calls or complex metadata parsing.
With Spring ’26, dependency information is included in the response, allowing developers to build dynamic forms without writing additional logic.
Real-World Use Cases
This feature is particularly useful in many Salesforce implementations.
Dynamic Lightning Web Components
Display only the picklist values available for the selected record type.
Screen Flows
Populate Flow picklists dynamically without hardcoding values.
Apex REST APIs
Expose record type-aware metadata to external systems.
OmniStudio Applications
Generate dynamic forms based on record type configuration.
Metadata-Driven Applications
Create reusable applications that automatically adapt to record type changes.
Why This Feature Matters
This enhancement offers several benefits:
Simpler Code
Developers no longer need to write custom callout logic or maintain wrapper classes.
Better Performance
Everything is retrieved through a native Apex method without making additional HTTP requests.
Easier Maintenance
Changes to record types or picklist values are automatically reflected without updating custom code.
Improved Reliability
Since Salesforce handles the filtering internally, there’s no risk of accidentally exposing invalid picklist values.
Before vs. After
| Before Spring ’26 | Spring ’26 |
| Schema Describe returned all active values | Returns only record type-specific values |
| Required UI API callouts | Native Apex method |
| JSON parsing required | Strongly typed Apex objects |
| Additional utility classes | Minimal code |
| Complex dependent picklist handling | Built-in dependency support |
| Higher maintenance | Cleaner and more maintainable |
Conclusion
The ability to retrieve record type-specific picklist values directly in Apex is one of the most practical enhancements introduced in Salesforce Spring ’26. It removes the need for complex workarounds, simplifies development, and enables developers to build cleaner, more dynamic applications with less code.
Whether you’re developing Lightning Web Components, Apex REST services, Flows, or metadata-driven applications, this new API provides a straightforward and reliable way to access picklist values exactly as users see them in Salesforce.
If you’ve ever written custom code just to fetch record type-specific picklist values, you’ll appreciate how much easier this new feature makes the job. It’s a small API addition with a big impact on everyday Salesforce development.
By following the above blog instructions, you will be able to learn “Salesforce Spring ’26: Retrieve Record Type-Specific Picklist Values Directly in Apex“. If you still have queries or any related problems, don’t hesitate to contact us at salesforce@greytrix.com. More details about our integration product are available on our website and Salesforce AppExchange.
We hope you may find this blog resourceful and helpful. However, if you still have concerns and need more help, please contact us at salesforce@greytrix.com.
About Us
Greytrix – a globally recognized and one of the oldest Sage Development Partner and a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners and Sage PSG across the globe. We offer Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that require apex code incorporation into the Salesforce platform.
Greytrix has some unique solutions for Cloud CRM such as Salesforce Sage integration for Sage X3, Sage 100 and Sage 300 (Sage Accpac). We also offer best-in-class Cloud CRM Salesforce customization and development services along with services such as Salesforce Data Migration, Integrated App development, Custom App development and Technical Support business partners and end users. Salesforce Cloud CRM integration offered by Greytrix works with Lightning web components and supports standard opportunity workflow. Greytrix GUMU™ integration for Sage ERP – Salesforce is a 5-star rated app listed on Salesforce AppExchange.
The GUMU™ Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for processing and execution of application programs at the click of a button.
For more information on our Salesforce products and services, contact us at salesforce@greytrix.com. We will be glad to assist you.