• Aqib Anjum
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am trying to display below lightning form in modal popup using overlay library. Please let me know how to do. 
I have overrided below form with Contact New button. Thanks.
    
    <aura:component implements="force:appHostable,lightning:actionOverride" access="global" >
    <aura:attribute name="recordId" type="String" /> <lightning:overlayLibrary aura:id="popuplib"/>
    <div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
        <lightning:recordEditForm objectApiName="Contact" onsuccess="{!c.handleSuccess}">
            <lightning:messages />
            <lightning:inputField fieldName="FirstName" />
            <lightning:inputField fieldName="LastName" />
            <lightning:inputField fieldName="Birthdate" />
            <lightning:inputField fieldName="Phone" />
            <lightning:button aura:id="submit" type="submit" label="Save record" class="slds-m-top_medium" />
            </lightning:recordEditForm>
    </div>  
</aura:component>

Client side controller:

({
    handleSuccess : function(component, event, helper) {
        
        var contactRec = event.getParams().response;
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
           "recordId": contactRec.id,
           "slideDevName": "related"
       });
        
       navEvt.fire();
    }  
})