function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tim D TaylorTim D Taylor 

Display picklist values by Record Type in Lightning Component

I'm porting existing functionality from a visualforce plus tabs community to a lightning based Napili templated community.

In Visualforce pages, you can use the apex:inputField tag for a picklist field to render only the options for a specific record type.

In a Lighting component when I use the force:inputField tag, ALL picklist values are rendered.
When I try and populate from an apex class call using the Schema.DescribeFieldResult to populate a ui:inputSelect or a lightning:select, I still get ALL picklist values and not just the values based on the record type.

Is there a way to only render picklist values per record type in a lightning component?
 
Tim D TaylorTim D Taylor
I'll try and provide some code snippets to better explain:
In my lightning component, I populate my Case object from an init method and then display a select component for a custom field on the case.
The select contains ALL values and not just the values defined for the Case Record Type.
 
<aura:component controller="CCCaseForm" implements="force:appHostable,forceCommunity:availableForAllPageTypes" access="global" >
    <aura:attribute name="cs" type="Case" default="{'sobjectType':'Case'}" />
    <aura:handler name="init" 
                  value="{!this}" 
                  action="{!c.doInit}"/>

    .... [some more markup]

        <force:inputField aura:id="submissionmethod" value="{!v.cs.Submission_Method__c}" class="form-control"/>

    ....[some more markup]
</aura:component>

In my VisualForce page, the select component properly displays ONLY the picklist values defined for the Case Record Type.
 
​<apex:page standardController="Case" extensions="CCCase" >

    .... [some more markup]

    <apex:inputField id="submissionmethod" value="{!cs.Submission_Method__c}" styleClass="form-control input-sm select2">

    .... [some more markup]

</apex:page>

Does anyone know of a way to properly limit the select options based on the record type in a Lightning component?