function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sfadm sfadmsfadm sfadm 

How to migrate custom lookup visualforce page to Lighting Experience?

I have a custom lookup visualforce page implemented exactly as it is explained here (
I need to know how to migrate my custom lookup visualforce page:
<apex:page id="SearchAccount" showHeader="false" sidebar="false" controller="SearchAccountController">
    <apex:includeLightning  />
      // 'LookupVfApp' Is Lightning Application Name
    $Lightning.use("c:LookupVfApp", function() {

      // 'LcForLookupVf' is Lightning Component Name
      // Set Lightning Component Attributes Property before creating Lightning Component In Visualforce page
        label : "Press Me!"
    function(component) {

            var newWin = null;

            function openLookupPopup(Name, id) {
                var url = "/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
                newWin =, 'Popup', 'height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
                if (window.focus) {
                return false;

            function closeLookupPopup() {

                if (null != newWin) {

        <apex:actionFunction name="populateNumber" action="{!PopulateAccNumber}" rerender="accinfo, msgs" />

       <apexoutputText value="Name"/>
            <apex:inputHidden value="{!accountId}" id="targetId" />
            <apex:inputText value="{!laccountName}" id="targetName" onFocus="this.blur()"/>
       <div id="LcDisplayId"></div>
                    <!--  <a href="#" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</a> -->                
        <apex:outputText value="{!accountnumber}" id="accinfo"/>

So far I created a LcForLookupVf.cmp lightning component:
<aura:component implements="force:appHostable,force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes" access="global">

    <ui:button label="navigateToURL" press="{!c.gotoURL}" />

The it is explained here ( I Created a LcForLookupVfController.js:
gotoURL : function(component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
        "url":"vfpage url"
Created a Lightning Application:
<aura:application access="GLOBAL" extends="ltng:outApp"> 
    <aura:dependency resource="c:LcForLookupVf"/>
Please advise how to add the openLookupPopup function:
function openLookupPopup(name, id)
        let url = new URL("{!URLFOR($Page.opptyStepMailPopup)}");
        let params = url.searchParams;
        //Add parameters
        params.append('namefield', name);
        params.append('idfield', id);, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus)

        return false;
to my LcForLookupVfController.js and be able to navigate the Lookup link to pop up and open the
User-added imagelookup window?