I have created a lightning component (aura) for custom lookup and use that popup in the object detail page (used component in vf and put that vf page in object page layout).

enter image description here

How can we open this above modal window in the parent record (Object detail page) ?

<!-- Moadal Popup for showing the search window on press of lookup icon -->
<div role="dialog" tabindex="-1" aura:id="TaskLookup" class="slds-modal slds-fade-in-open visibilityNO">
    <div class="slds-modal__container">
        <div class="slds-modal__header" style="padding-bottom:15px;">
            <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.HideTaskPopup}">
                <c:SVG class="slds-button__icon slds-button__icon--large" xlinkHref="{!$Resource.LightningIcons + '/utility-sprite/svg/symbols.svg#close'}"></c:SVG>
                <span class="slds-assistive-text">Close</span>
            <ui:inputText label="Activity Title" updateOn="keyup" change="{!c.keyPressController}" class="slds-lookup__search-input slds-input" value="{!v.SearchKeyWord}" placeholder="Search Activity..." />
        <div class="slds-modal__content slds-p-around--medium">
            <div class="slds-lookup__item--label slds-text-body--small">{!v.Message}</div>
            <table class="slds-table slds-table--bordered slds-table--cell-buffer slds-table_fixed-layout">
                    <tr class="slds-text-heading--label">
                        <th scope="col" width="35%"><span class="slds-truncate">Activity Title</span></th>
                        <th scope="col"><span class="slds-truncate">Created Date</span></th>
                        <th scope="col"><span class="slds-truncate">To Do Type</span></th>
                        <th scope="col"><span class="slds-truncate">Digital Channel</span></th>
                        <th scope="col"><span class="slds-truncate">Owner</span></th>
                    <!--Child component for showing the searched result -->
                    <aura:iteration items="{!v.SearchedResult}" var="obj">
                        <c:Activity_customLookup_Child2 tsk="{!obj}" />
        <div class="slds-modal__footer">
            <ui:button label="Cancel" class="slds-button slds-button--brand" labelClass="label" press="{!c.HideTaskPopup}" />


  • try this once, lightning:overlayLibrary Mar 8 '21 at 13:42
  • @itzmukeshy7 tried but it gives me this error This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'setParams' of undefined] Failing descriptor: {markup://lightning:overlayLibrary}
    – Nihar
    Mar 8 '21 at 14:34
  • Can you share that code? Mar 8 '21 at 14:50
  • $A.createComponent("lightning:card",{"title" : "Dynamically Created Card",}, function(this, status) {if (status === "SUCCESS") {var modalBody = this; component.find('popuplib').showCustomModal({header: "Test Modal", body: modalBody, showCloseButton: true, closeCallback: function(ovl) { console.log('Overlay is closing'); } }).then(function(overlay){ console.log("Overlay is made"); }); } });
    – Nihar
    Mar 8 '21 at 15:12
  • @itzmukeshy7 just used the simple code to show modal on the parent record.
    – Nihar
    Mar 8 '21 at 15:12

Your Answer

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

Browse other questions tagged or ask your own question.