{"id":13143,"date":"2026-08-27T05:39:19","date_gmt":"2026-08-27T05:39:19","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/salesforce\/?p=13143"},"modified":"2026-08-27T05:39:21","modified_gmt":"2026-08-27T05:39:21","slug":"salesforce-spring-26-retrieve-record-type-specific-picklist-values-directly-in-apex","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2026\/08\/27\/salesforce-spring-26-retrieve-record-type-specific-picklist-values-directly-in-apex\/","title":{"rendered":"Salesforce Spring \u201926: Retrieve Record Type-Specific Picklist Values Directly in Apex"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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&#8217;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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With Salesforce Spring \u201926, 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">The Challenge Before Spring \u201926<\/mark><\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine an organization with two Opportunity record types:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Retail<\/li>\n\n\n\n<li>Enterprise<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The Stage picklist might contain different values for each record type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Retail<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Prospect<\/li>\n\n\n\n<li>Negotiation<\/li>\n\n\n\n<li>Closed Won<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Enterprise<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Discovery<\/li>\n\n\n\n<li>Proposal<\/li>\n\n\n\n<li>Contract Review<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Previously, using the following Apex code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Schema.DescribeFieldResult describeResult=Opportunity.StageName.getDescribe();\nList&lt;Schema.PicklistEntry> values = describeResult.getPicklistValues();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">would return every active picklist value, regardless of the selected record type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This meant developers had to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Build UI API callouts from Apex<\/li>\n\n\n\n<li>Parse JSON responses<\/li>\n\n\n\n<li>Create reusable wrapper classes<\/li>\n\n\n\n<li>Maintain additional code just to retrieve the correct picklist values<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">While these workarounds solved the problem, they increased complexity and made applications harder to maintain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"><strong>What&#8217;s New in Spring \u201926?<\/strong><\/mark><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Salesforce has introduced a new Apex method that returns picklist values based on a specific record type.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u00a0recordTypeId = Schema.SObjectType.Account\n\u00a0 .getRecordTypeInfosByDeveloperName()\n  .get('Business_Account')\n  .getRecordTypeId();\nConnectApi.PicklistValuesCollection result =\n    ConnectApi.RecordUi.getPicklistValuesByRecordType(\n         'Account',\n       recordTypeId\n );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With just a single method call, developers can now retrieve all picklist fields and their values exactly as configured for the specified record type.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No HTTP callouts.<\/li>\n\n\n\n<li>No JSON parsing.<\/li>\n\n\n\n<li>No custom utility classes.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Accessing Values for a Specific Field<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Suppose you want to retrieve the Rating picklist values for the selected record type.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ConnectApi.PicklistFieldValues ratingValues = result.picklistFieldValues.get('Rating');\nfor (ConnectApi.PicklistValue value : ratingValues.values) {\n       System.debug(value.label);\n       System.debug(value.value);\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hot<br>Warm<br>Cold<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Only the values assigned to the specified record type are returned.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Support for Dependent Picklists<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another major advantage of this enhancement is support for dependent picklists.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Consider the following relationship:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Country <br>   \u2193 <br>State <br>   \u2193 <br>City<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In earlier releases, retrieving dependency mappings required additional API calls or complex metadata parsing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With Spring \u201926, dependency information is included in the response, allowing developers to build dynamic forms without writing additional logic.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Real-World Use Cases<\/mark><\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This feature is particularly useful in many Salesforce implementations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Dynamic Lightning Web Components<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Display only the picklist values available for the selected record type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Screen Flows<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Populate Flow picklists dynamically without hardcoding values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Apex REST APIs<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Expose record type-aware metadata to external systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>OmniStudio Applications<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generate dynamic forms based on record type configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Metadata-Driven Applications<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create reusable applications that automatically adapt to record type changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Why This Feature Matters<\/mark><\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This enhancement offers several benefits:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Simpler Code<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Developers no longer need to write custom callout logic or maintain wrapper classes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Better Performance<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Everything is retrieved through a native Apex method without making additional HTTP requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Easier Maintenance<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Changes to record types or picklist values are automatically reflected without updating custom code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Improved Reliability<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since Salesforce handles the filtering internally, there&#8217;s no risk of accidentally exposing invalid picklist values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Before vs. After<\/mark><\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>\u00a0Before Spring \u201926<\/strong><\/td><td><strong>Spring \u201926<\/strong><\/td><\/tr><tr><td>Schema Describe returned all active values<\/td><td>Returns only record type-specific values<\/td><\/tr><tr><td>Required UI API callouts<\/td><td>Native Apex method<\/td><\/tr><tr><td>JSON parsing required<\/td><td>Strongly typed Apex objects<\/td><\/tr><tr><td>Additional utility classes<\/td><td>Minimal code<\/td><\/tr><tr><td>Complex dependent picklist handling<\/td><td>Built-in dependency support<\/td><\/tr><tr><td>Higher maintenance<\/td><td>Cleaner and more maintainable<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Conclusion<\/mark><\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The ability to retrieve record type-specific picklist values directly in Apex is one of the most practical enhancements introduced in Salesforce Spring \u201926. It removes the need for complex workarounds, simplifies development, and enables developers to build cleaner, more dynamic applications with less code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you&#8217;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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;ve ever written custom code just to fetch record type-specific picklist values, you&#8217;ll appreciate how much easier this new feature makes the job. It&#8217;s a small API addition with a big impact on everyday Salesforce development.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By following the above blog instructions, you will be able to learn \u201c<strong>Salesforce Spring \u201926: Retrieve Record Type-Specific Picklist Values Directly in Apex<\/strong>\u201c. If you still have queries or any related problems, don\u2019t hesitate to contact us at <a href=\"mailto:salesforce@greytrix.com\" target=\"_blank\" rel=\"noreferrer noopener\">salesforce@greytrix.com<\/a>. More details about our integration product are available on <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/\" target=\"_blank\" rel=\"noreferrer noopener\">our website<\/a> and <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/\" target=\"_blank\" rel=\"noreferrer noopener\">Salesforce AppExchange<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We hope you may find this blog resourceful and helpful. However, if you still have concerns and need more help, please contact us at <a href=\"mailto:salesforce@greytrix.com\" target=\"_blank\" rel=\"noreferrer noopener\">salesforce@greytrix.com<\/a>.<\/p>\n\n\n\n<p style=\"text-align: justify\"><b>About Us<\/b><\/br>\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> \u2013 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.<br><br> Greytrix has some unique solutions for Cloud CRM such as <a href=\"\">Salesforce Sage integration<\/a> for <a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/integration\/\">Sage X3<\/a>, <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/sage-100-integration\/\">Sage 100<\/a> and <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/sage-300-integration\/\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/crm-development\/\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/data-migration-support\/\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/crm-development\/\">Integrated App development<\/a>, 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&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star rated app listed on <a href=\"https:\/\/appexchange.salesforce.com\/appxListingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<br> The GUMU&#x2122; 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.<br><br> For more information on our Salesforce products and services, contact us at <a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t determine which values were actually available for a specific record type. As a result, developers often had to rely on UI API\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2026\/08\/27\/salesforce-spring-26-retrieve-record-type-specific-picklist-values-directly-in-apex\/\">Read More: Salesforce Spring \u201926: Retrieve Record Type-Specific Picklist Values Directly in\u2026 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[3651,3634,3656,3644,3647,3654,3638,3658,3635,3636,3648,3637,2467,588,3633,3304,3641,3661,3659,1709,3646,3317,1773,3649,3083,3012,392,2782,2706,3650,3655,3652,3653,3526,3657,3639,3660,2418,3642,3562,3533,3640,3569,3581,2584,1410,3643,1833,3630,3632,3629,3631,3662,3645],"class_list":["post-13143","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-apex-dependent-picklists","tag-apex-picklist-values","tag-apex-rest-services","tag-apex-schema-describe","tag-connectapi-recordui","tag-dynamic-picklist-values-salesforce","tag-get-picklist-values-by-record-type","tag-metadata-driven-salesforce","tag-record-type-picklist-values","tag-record-type-specific-picklist-values","tag-recordui-getpicklistvaluesbyrecordtype","tag-retrieve-picklist-values-in-apex","tag-salesforce-admin","tag-salesforce-apex","tag-salesforce-apex-api","tag-salesforce-apex-development","tag-salesforce-apex-record-type","tag-salesforce-apex-tutorial","tag-salesforce-api-enhancements","tag-salesforce-automation","tag-salesforce-connectapi","tag-salesforce-crm-development","tag-salesforce-customization","tag-salesforce-dependent-picklists","tag-salesforce-developer","tag-salesforce-developer-guide","tag-salesforce-development","tag-salesforce-development-best-practices","tag-salesforce-dynamic-forms","tag-salesforce-dynamic-picklists","tag-salesforce-flow-picklist","tag-salesforce-lightning-web-components","tag-salesforce-lwc-picklist","tag-salesforce-new-features","tag-salesforce-omnistudio","tag-salesforce-picklist-api","tag-salesforce-picklist-configuration","tag-salesforce-picklist-dependencies","tag-salesforce-picklist-management","tag-salesforce-picklist-values","tag-salesforce-programming","tag-salesforce-record-type-api","tag-salesforce-record-type-configuration","tag-salesforce-record-type-picklist","tag-salesforce-release-updates","tag-salesforce-rest-api","tag-salesforce-schema-describe","tag-salesforce-screen-flow","tag-salesforce-spring-26-2","tag-salesforce-spring-26-features","tag-salesforce-spring-26-release-2","tag-salesforce-spring-26-updates","tag-salesforce-spring-release-2026","tag-schema-describefieldresult"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/13143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=13143"}],"version-history":[{"count":7,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/13143\/revisions"}],"predecessor-version":[{"id":13150,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/13143\/revisions\/13150"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=13143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=13143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=13143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}