0

Showing a error when i am trying to access account lookup.

enter image description here

<aura:attribute name="contact" type="Contact" 
           default="{ 'sobjectType': 'Contact' }" access = "public"/>

<force:inputField aura:id="accountid" value="{!v.contact.AccountId}"/>
1

[EDIT] You can use reuse Strike components, just copy code to your Salesforce and it is ready to use.

http://www.lightningstrike.io/#!/strikeLookup

https://github.com/appiphony/Strike-Components

The default Salesforce components do not support lookup, you have to build your custom component. However you can reuse code from here, I used it too, 100% working:

http://www.sfdcmonkey.com/2017/01/07/custom-lookup-lightning-component/

Here is official article by Salesforce: https://developer.salesforce.com/blogs/developer-relations/2015/06/salesforce-lightning-inputlookup-missing-component.html

Salesforce Spring ’15 release brought some brand new components ready to be used in your lightning apps. One of the missing components that could be useful for your apps is the input lookup component.

Another resource testifying this: https://developer.salesforce.com/forums/?id=9060G000000XZmuQAG

  • I don't want to use any custom lookup. – Tariq Jun 6 '17 at 9:59
  • Please see my edits. It looks there is no other way for now. – Vladyslav K Jun 6 '17 at 10:05
0

@Tariq As of now you don't have any other option than to create your own lightning component for input Lookup.

I have created one for my business purpose. Here is the link to it:

InputLookUp

Other than that you can also use a ALJS a third party library for input Lookup as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.