When we are creating a record using lightning:recordForm and the object on which record is being created has any dependent lookup filter field, then the lookup will not work.
Steps to replicate:-
- Create a custom object.
- Add two fields - Contact and Account.
- Add a filter so that the Contact field only shows contacts from the Account Name field selection on the same record.
- Now create a lightning component with lightning:recordForm passing the objectApiName as the custom object created in Step 1.
- Contact lookup only shows the contact whose account is null, eventhough you select an account in account lookup.
This is a common issue regardless of the lightning component you use to create a new record. This issue can be encountered when you use:-
- lightning:inputField in lightning:recordEditForm
The only exception where dependent lookup filter field works fine is force:createRecord
Much needed fix.