Dependent Picklist Value Not Persisting Value On Controlling Field Change
Last updated 2021-04-06 ·Reference W-8157999 ·Reported By 10 users
In Winter' 21 when a lightning:recordEditForm has a controlling and dependent picklist field, changing the controlling field does not persist the dependent field if it is still a viable option for the new controlling field.
1. In a Winter '21 dev org (https://www.salesforce.com/form/signup/prerelease-winter21/), create a test Opportunity record.
2. Create a new custom field on the Opportunity object called "Dependent_On_Stage__c" and enter the values 1, 2, 3, 4.
3. Go to "Field Dependencies" on the "Fields & Relationships" screen and add a New entry. Set the Controlling Field to "Stage", and the Dependent Field to "Dependent On Stage".
4. Add the options 1 and 2 for all fields except "Needs Analysis". For this, select 3 and 4.
5. Create a lightning component with the following code, using the recordId for the Opportunity created above:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
<lightning:recordEditForm objectApiName="Opportunity" recordId="006...">
<lightning:inputField fieldName="StageName" />
<lightning:inputField fieldName="Dependent_on_Stage__c" />
6. Go to the Opportunity record and edit the page, adding the component above to the page.
7. You should now be able to try switching between Prospecting and Qualification (for example) and see that the 1 is cleared to --None-- rather than persisting as 1. In Summer '21 the 1 remained, so this is the issue/change in behavior.
No workaround at this time.
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.