1

I have a page on console where case number is shown as hyperlink. When it is clicked it should open in the same tab which is primary tab. I created formula field using Hyperlink function.It is opening the case in new tab. How can I show the case in the same tab?

HYPERLINK('https://dev2.salesforce.com/console?tsid=02u50000000VVyQ#%2F'+ id,Casenumber)

I tried using _self,_top,_parent as third parameter, But they did not give me the result as I desired

1

You need to inject javacript to open the record in same tab.

Here is an example

HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcSelf('/" & Id & "');} "+ 
" else {window.location.href='/" & Id & "'}" 
,Casenumber 
, "_self" 
)

For more information, refer my blog. Different ways of navigation

Update

As per comment, take this approach, for create a Custom Button or Link executing JavaScript

{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")} 
{!REQUIRESCRIPT("/support/console/28.0/integration.js")} 
var url = '/apex/VisualforcePage'; 
if (sforce.console.isInConsole()) { 
navigateToUrl(url + '?inline=1'); 
} else { 
window.open(url,'_self'); 
}
2

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.