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
Brooke BakerBrooke Baker 

lightning:recordEditForm - lightning:inputField - Lookups not working in Salesforce1

Does anyone know how to get the inputfield for a reference field/lookup working on Salesforce1.

Ive built a custom componet with a recordEditform that is launched from an object action button and shows the lookups correctly. But in Salesforce1 it shows just a input text fields. 
Ankur Gandhi 13Ankur Gandhi 13
Hi Brooke,
This is not supported yet by recordEditForm. 
Look at the below description from component library.
https://developer.salesforce.com/docs/component-library/bundle/lightning:recordEditForm/documentation

Usage Considerations
The lookup type is supported in Lightning Experience only. When used in the mobile app, the lookup type is rendered as an input text field. The geolocation compound field is not supported. Read-only fields are displayed as input fields that are disabled
.

Thanks
Ankur
Ricardo SuárezRicardo Suárez
2020 and this is still not working... They should doing something ASAP as this functionality is something common to use
Danish HodaDanish Hoda
Hi All,
Yoi can use force:inputField as a workaround as shown below:

<aura:attribute name="contactObj" type="Account" default="{ 'sobjectType': 'Contact' }"/>
<force:inputField value="{!v.contactObj.AccountId}"/>
Mohammad AnisMohammad Anis
Hi Danish,
I tried using force:inputField in my lightning component and It is working fine for a quick action, however the same is not working when I am using the same lightning component in a VF using LightningOut. Any idea what could be the possible cause of this?

P.S. I am using it in Salesforce1.

Thanks,
Mohammad Anis
Danish HodaDanish Hoda
Hi Anis,
force:inputField doesn't support when a component is imbedded under a VF page.
Mohammad AnisMohammad Anis
By any chance did u got to know any workaround for this as even force:inputField does not work for Salesforce1 :(
Danish HodaDanish Hoda

Hi Anis, unfortunately you will need to use custom lookup component to achieve your requirement.

You can refer - https://sfdcmonkey.com/2017/07/17/re-usable-custom-lookup/

Mohammad AnisMohammad Anis
Hi Danish, I guess custom lookup too not supported in Salesforce1.
Thanks.
Danish HodaDanish Hoda
Hi Anis,
The issue is the VF page that too on Salesforce1, else Salesforce1 supports both force:inputField and the custom lookup component.