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
Frédéric ProvotFrédéric Provot 

Lookup popup not displayed anymore from VisualForce panel

Hello
We have for years lookup fields into a visualforce page (embedded in an account layout). These are lookups to search for accounts and contacts. This was working fine until recenly : when clicking on a lookup, a popup was raised to search as usual.

But now we have been alerted for a week that this doesn't work anymore, and working differently depending on the browser used :
- On Chrome : 
    - clicking on the "magnifying glass" opens a new blank chrome tab. 
    - pressing CTRL while clicking opens the popup as normal.
- On Firefox : 
    - clicking on the "magnifying glass" opens a new blank chrome tab. 
    - pressing CTRL while clicking opens a new blank chrome tab also.
On opera :
    - clicking on the "magnifying glass" opens the popup as normal.

Note that the if the same lookups are used directly on an account page (not in visualforce), they work normaly. The visualforce panel is embedded in accounts page layout. This may occurs for weeks as these fields are not used every day.

We tried with old versions of firefox : the same. We tried old and very old sandbox not uptodate (1,5 years old): the same.
Our Visualforce page and controller haven't changed for years.
So I believe that it is linked to the SUMMER 19 salesforce version.

I analyzed SF logs, browser inspectors logs. No error. The generated URL is having an additional dplp element out of visualforce page, but it doesn't seem relevant.
I searched on forums, known issues. Not found anything.

Anybody is experiencing the same issue? Or have an idea on this issue?
Best Regards
Frederic
Anybody is experiencing the same issue? Or have an idea on this issue?
Best Regards
Frederic
Best Answer chosen by Frédéric Provot
Frédéric ProvotFrédéric Provot
I resolved this.
Well I still don't know what have changed (browsers behaviour, salesforce behaviour...), but I added a javascript that force a different behaviour when in edit mode (magnifiying glass click) and read mode (link click) : set the target attribute of links on the page.
 
<script >
          $j = jQuery.noConflict();
          $j(document).ready(function() {
          if ({!not(inline)}) {   /* value of inelineedit */
            $j('a').attr("target","_self"); /* use current context (default) : popup mode working*/
          } else {
            $j('a').attr("target","_top"); /* display in top context (whole page) : link follow working */
          }
    });
   </script>
Now whatever the browser is, lookup popup display well in edit mode, and in display mode, lookup link replaces the current page.
Hope this can help.
Frederic