Lookup field with option to create new record in Custom Lightning Component

Sample Code:

<aura:component implements="force:appHostable" >

     <aura:attribute name="oppty" 
                    type="Opportunity" 
                    default="{ 'sobjectType': 'Opportunity'}"/>
    
    <div class="slds-box slds-theme_default">
        Account : <force:inputField value="{!v.oppty.AccountId}"/>
    </div>
    

</aura:component>

Output:


2 comments:

  1. how to create Multi select Lookup field with option to create new record in Custom Lightning Component?

    ReplyDelete
    Replies
    1. You have to create a custom search page so that you can select multiple using check boxes instead of lookup field. You have to use wrapper kinda design.

      Delete