force:inputField does not support field dependency
Last updated 2017-05-09 ·Reference W-3657028 ·Reported By 7 users
Summary
Using force:inputField with a dependent picklist doesn't load the field's dependency information. This is for both single and multiselect picklists.
Repro
Aura <force:inputField> is disabled in a custom Lightning component when using custom multi-select picklist with controlling field
Create a custom component and app with the following code:
Code used:(Component)
<aura:component >
<aura:attribute name="opportunity" type="Opportunity" default="{ 'sobjectType': 'Opportunity' }"/>
<div class="slds-form-element">
<label class="slds-form-element__label" for="opportunityStage">Stage</label>
<force:inputField class="slds-input" aura:id="opportunityStage" value="{!v.opportunity.StageName}" />
</div>
<div class="slds-form-element">
<label class="slds-form-element__label" for="opportunityStage">Closed_Lost_Reasons</label>
<force:inputField aura:id="opportunityCloseReason" value="{!v.opportunity.Close_Lost_Reason__c}" />
</div>
</aura:component>
Code Used: (App)
<aura:application >
<c:KI_Test_Component />
</aura:application>
Note that: StageName is the controlling field and and Close_Lost_Reason__c is the multiselect picklist field on Opportunity object
Now:
1. Go to app: https://cofi--lightning.lightning.force.com/c/KI_Test.app
2. Pick any value for Stage field.
3. Note that the Closed_Lost_Reasons field is greyed out
Workaround
If field dependency is needed, force:recordEdit should be used on a record.
Reported By (7)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.