I have a VF page that displays a datatable. However, neither the Global Search nor the Sidebar collapse button work when I'm on the VF page.

enter image description here

Any ideas? Note: In the custom button that spawns the VF page and the VF page itself I have code that detects whether the page in opened in the standard interface or the service console.


  • 2
    Presumably your page's JavaScript is breaking the platform's JavaScript. First check the JavaScript console for errors. Then review the JavaScript (including any script includes as all that included code runs immediately too). If it is still not clear what the problem is, remove JavaScript pieces from your page one by one until you find the problematic piece.
    – Keith C
    Apr 5, 2016 at 21:37

1 Answer 1


Yes I was overwriting the default onload functionality. Used the following code to detect default onload functionality and append any additional custom actions to it:

function addLoadEvent(func){ 
        var oldonload = window.onload; 
        if (typeof window.onload != 'function') 
                window.onload = func; 
                window.onload = function()  
                    if (oldonload) 

  • 1
    Really, you shouldn't be using the old-school "onload" handler anyways. A more appropriate design for modern code is to instead use window.addEventListener. This means you don't have to worry about all that code you have now and can just get on doing whatever it is your code is doing.
    – sfdcfox
    Apr 8, 2016 at 15:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .