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
Jeffrey CheungJeffrey Cheung 

lightning:inputField is not working with lookup field

A Negotiation object looks up to an Opportunity. The Opportunity Id is in the event but it is gone in the trigger, hence the required field missing error.

User-added image
Best Answer chosen by Jeffrey Cheung
Jeffrey CheungJeffrey Cheung

This is a bug in lightning:inputField with Master-Detail relationship. The same error has been rasied 3 months ago already: https://salesforce.stackexchange.com/questions/207479/anyone-got-a-lightninginputfield-working-for-a-lookup/207935

Sadly Salesforce doesn't care about this bug so it is not fixed.

The only solution is:
1. Check "Allow reparenting" checkbox for the Master-Detail field on the child object
2. Change the relationship to a lookup

All Answers

krisstannum1krisstannum1
Hi! May we see your component/controller codes please? Thank you!
Jeffrey CheungJeffrey Cheung

This is a bug in lightning:inputField with Master-Detail relationship. The same error has been rasied 3 months ago already: https://salesforce.stackexchange.com/questions/207479/anyone-got-a-lightninginputfield-working-for-a-lookup/207935

Sadly Salesforce doesn't care about this bug so it is not fixed.

The only solution is:
1. Check "Allow reparenting" checkbox for the Master-Detail field on the child object
2. Change the relationship to a lookup

This was selected as the best answer