[SalesForce] 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 it looks like all picklist (ui:inputSelect) values must be created as ui:inputSelectOptions and will not populate dynamically. This is problematic for record types since we can't get record-type specific picklist values from the server-side controller.

Also, thoughts/best practices for handling dependent picklists?

Your insights are appreciated.

Best Answer

After switching from ui:inputSelect to lightning:select , I was able to use the standard html options.


<aura:attribute name="options" type="String[]" />
<aura:handler name="init" value="{!this}" action="{!c.doinit}" />
<aura:attribute name="selectValue" type="String" />
<lightning:select aura:id="myselection" value="{!v.selectValue}">
<aura:iteration items="{!v.options}" item="option">
<option value="{!option}">{!option}</option>