SFDCBug
SFDCBug

Reputation: 11

Option to create new record from lookup in lightning component - using recordeditform

I am using a lightning:recordEditForm to show some fields on UI. In that there are lookup of Account , contact and opportunity which i am populating using some backend logic using fieldsets. How can i provide a "New Contact" option when a user clicks on the Contact lookup? This option shows in standard lookups, is it possible in this scenario as well?

Also, is it possible that i can control the search suggestions which user will get on clicking on a particular lookup? Like on clicking of Opportunity lookup , Only those opportunities should be shown in suggestion which has stagename not equals to closed won

Upvotes: 1

Views: 973

Answers (1)

Avnish Yadav
Avnish Yadav

Reputation: 71

I think you cannot create New Contact in contact lookup by using lightning:recordEditForm but you can try creating a custom Lookup component and then add in your component without using Lightning Data Service i.e. lightning:recordEditForm

The below link helps you see that the lookup field's dropdown menu is currently not supported.

https://developer.salesforce.com/docs/component-library/bundle/lightning-input-field/documentation

Upvotes: 0

Related Questions