+ Start a Discussion

Srcup not defined on javascript button opening Visualforce page

I have a on click javascript button on the case pagelayout which opens a visual force page and was working fine but suddenly user started getting error Url does not exists. but when I login as user and click on that button I see "srcUp is not defined" error. 

Here is the simple javascript on that button. 

AbhishekAbhishek (Salesforce Developers) 
Here is an example of the JS in button to open a VF page in console.

if(typeof(srcUp) == 'function') //Checks that it is in console

var openSubtab = function(result){ 
sforce.console.openSubtab(result.id,'/apex/YourVFPageName?caseID={!Case.Id}&inConsole=true', true, 'Subtab Name', null); 


SrcUp can be used to open subtabs in the service cloud console.

This Button code will handle the opening of the VF page in console and outside console very effectively.

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Hi Abhishek, 
Thanks for your inputs on using this button on console. I will use this approach going forward. 

This button has been working from years and suddenly one of our user started facing  the error when he clicked on this button in chrom browser,  and I suggested to try in some other browser which worked. He tried in firefox and also tried in chrom incognito both worked.  No other user reported this, so my conclusion was that some issue in user chrome browser or he installed some extension which is creating this conflict.