+ Start a Discussion
KyoKyo 

Hyperlink in Service Cloud Console not open new tab or subtab ?

I can't open tab or subtab for Hyperlink in formula field.

formula can do this.

 

HYPERLINK(Id,'Mr. ' &  FirstName & ' ' &  LastName, '_parent') 

 

Thank you so much.

sfdcfoxsfdcfox

New tab should be "_blank", not "_parent." The latter is used to take over the current tab, while the former opens a new window or tab, depending on the user's tab preferences.

PamSalesforcePamSalesforce

I am facing the same issue. Where you able to resolve this?

troy controy con

I'm trying to do something similar.  Don't know if you can use the Service Cloud toolkit from formula fields..  I basically want to open a new service console tab from a listview.

 

Trying this, but it's not working and I don't really know of a good way to go from here.

 

HYPERLINK("javascript:sforce.console.openPrimaryTab(null, 'http://www.salesforce.com', false, 'salesforce', null, 'salesforceTab')",'View contact in summary view')

BijayBijay

Even i am facing the same issue i am not able to access the Hyperlink function (In formula field) in service console to open in a new sub-tab window.

 

Here is my function and logic:

 

HYPERLINK(“javascript: var urlString = '/apex/VFP_CustomLink';
 

if (typeof(srcUp) == 'function') {

 

srcUp(urlString);

} else {

window.open(urlString);

}
Awaiting for the resolution.

 

Thanks so much.

 

 

BijayBijay

I have Used Visual force in urlstring.......you can use https://www.bing.com....

BijayBijay

Well Troy ,

 

I got one solution for that .

Please try and let me know if its working for you.

 

HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('/URLDomainName?isdtp=vw'); } "+

"else {window.location.href='/URLDomainName?isdtp=vw'}","salesforceTab", "_parent")

 

 

Thanks..:)

 

Brad BuilderBrad Builder

Thanks for the info everyone.  The examples work great, BUT, my formula fields won't work when I want to pass in a merge field.  For example, I'd like to include the current record Id as a URL parameter.  The "Id" field does not convert to the actual recordId, but stays as text "Id".  The merge fields word perfectly if they are outside of the "javascript" section.

 

HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('/URLDomainName?isdtp=vw&accid='+Id); } "+

"else {window.location.href='/URLDomainName?isdtp=vw&accid='+Id}","salesforceTab", "_parent")

 

Any ideas?

 

Thanks,

Brad

 

Brad BuilderBrad Builder

Answering my own question... got it working.  Had to reposition variable to appear outside of string.  Here is the working example:

 

HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('/003/e?isdtp=vw&accid=" & Id & "');}"+
" else {window.location.href='/003/e?accid=" & Id & "'}",
"Create Contact",
"_self"
)

Andrew GrossAndrew Gross

Thanks for the 411 guys.

 

I have a similar question - can't quite get it to work.

 

Am trying to have a link to just pop an existing record in the SCC by passing in the record id, but not into edit mode, just view mode. My syntax is screwed up:

 

HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('/Id?isdtp=vw');}"+
" else {window.location.href='/Id?isdtp=vw'}",
"Link Text",
"_self"
)

 I tried placing it out of the string as well but my syntax is off there also....any ideas?

 

Thanks!

 

Brad BuilderBrad Builder
Try... HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('/" & Id & "?isdtp=vw');}"+ " else {window.location.href='/" & Id & "?isdtp=vw'}", "Link Text", "_self" ) Notice how I've pulled the Id merge field so that it appears outside of the double-quotes.
Andrew GrossAndrew Gross

Awesome!  Thanks a bunch.  Yeah I saw what you did in your example that worked for you, but couldn't translate it to my example.  I see now that it is two sets of double quotes - makes waaay more sense.  Thanks!

Mike MorrissMike Morriss

I'm having the same challenges getting a hyperlink to open as a tab within the Service Console.

 

current string is:

HYPERLINK("http://www.google.com/search?en&q="&Account.Name,"Query",'&isdtp=vw' )

 

I'm unclear what I need to add to the syntax to force the tab to open within the Service Console.

 

Any insight is appreciated.

PalakPalak

hii

 

Could you please let me know how can I set tab label using srcup method?

 

Its urgent please help me !!

 

Thanks in advance.

 

Regards

Palak

Prismatic.palak@gmail.com

Theresa MasonTheresa Mason
I have read and re-read this thread but still cannot get mine to work.  This formula is on a field on an article.  When viewing in the SCC and click on this link it does nothing.  Well...not exactly nothing, the name of the tab changes to "external tab"

The intent is to create a new record and pass a few values into the new record from the article.  Thanks!

HYPERLINK(
"https://na7.salesforce.com/a2N/e?retURL=%2Fa2N%2Fo&00NA000000AifEf="&Title&
"&00NA000000AifEb="&CreatedBy.Full_Name__c& 
"&00NA000000AifEa="&CreatedBy.Email &
"&CF00NA000000AgBxM="&$User.Full_Name__c ,
"Click Here",
"_self"
David Torres 9David Torres 9
We did it this way(adding manualy the integration.js to the page):

HYPERLINK("javascript:var html_doc = document.getElementsByTagName('head')[0]; var js =document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src','/support/console/31.0/integration.js');html_doc.appendChild(js); js.onload= function() { sforce.console.openPrimaryTab(null, '/apex/zissuedetails?key=ABM-45', false, 'salesforce', null, 'salesforceTab'); }; ",'View contact in summary view')

BEST!
manav_mnvmanav_mnv
Hi All,

Need urgent help, problem is similar as we are discussing above. I have One standard object Case and two custom objects(Tour and Order), relationship between them are: 1.) Case has lookup on Tour, 2.) Case has Lookup on Order, 3.)Tour & Order has MD relationship, where Tour is Master. I am using new SF console, in that when I open Cases, it appears in Primary tab, and in detail I have one Hyperlink formula field Tour Ref     
HYPERLINK("/apex/Booking_Detail_Loading?tourID=" & Order__r.Id & "&tourRef=" & Order__r.Tour_Reference__c, Order__r.Tour_Reference__c ,'_self') 

so when I click on Tour ref, it override Cases, and appear on Primary tab, but I want it to appear on Subtab.

How to do this guys, please suggest.

Regards,
Manav
Jessica GuevaraJessica Guevara
I am getting stuck with the following.  Our intent is to have our users open a campaign member from a campaign member report within the console. Our old formula field forced the user to revert back to classic.
HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('/" & Id &"');}" + " else {window.open('/"& Id &"')}", "View Member in Console", "_blank" )
AlvaroCostaAlvaroCosta
Hello all,

After JavaScript Disablement by Salesforce, is there anyway to accomplish the same behavior without JS in the formula field? 

Cheers!
PramodGavadePramodGavade

Hi All,

Can someone please help me with a work-around to support same behavior for formula fields within Sales Console with Winter 18 critical updates where Salesforce will stop supporting javascript from hyperlink formula fields.

Thanks,
Pramod

SUBHAJIT PALSUBHAJIT PAL

Hi All,
I have an implementation of opening a record in console with hyperlink formula field and javascript in it.
Now I have exactly same problem as Alcosta and Pramod Gavade 10, how to achive that post JavaScript Disablement by Salesforce in Winter 18?

We are going live in Nov and still I dont have any soln to it. :(

Regards,
Pal,Subhajit

SUBHAJIT PALSUBHAJIT PAL
Hi
I have an alternate soln, but it is opening as new external primary tab.

Hyperlink formula field
HYPERLINK("/apex/VF_PAGE?id="& Id , <Display_STRING>,"_top")
 
VF page
<apex:page standardController="OBJ__c" standardStylesheets="false" sidebar="false">
    <apex:includeScript value="/soap/ajax/26.0/connection.js"/>
    <apex:includeScript value="/support/console/26.0/integration.js"/>
    <script type="text/javascript">
        window.onload=function()      
        {       
            var myappname = document.getElementById("tsidLabel").innerText;// sforce.console.isInConsole() returning false, don’t know why.
            if(myappname.includes("Console")){
                window.location.href="/ui/support/servicedesk/ServiceDeskPage#/{!OBJ__c.id}";
            }
            else{
                window.location.href="/{!OBJ__c.id}";
            }   
        };
    </script>
</apex:page>
 
It’s not full proof solution as opening in Primary tab, sforce.console javascript apis are not working.
 
So please let us know if you have better soln.
 
BR,
Pal, Subhajit
 
AlvaroCostaAlvaroCosta
At this moment I am using the formula hyperlink with "_self":
HYPERLINK("/apex/CUSTOM_VF?id=" & Id, "_self")

But it opens my VF in a primary tab overwriting the current record primary tab.   =/
PramodGavadePramodGavade

Thanks Subhajit Pal. Here is a working version using your logic to determin isInConsole.

HYPERLINK('apex/RecommendationDetailsRedirect?recommendationId=' & Id & '&displayName=' & DisplayName__c, DisplayName__c, '_self')Custom Formula: 


Javascript on VF Page:
<script type="text/javascript" >    
    var myappname = document.getElementById("tsidLabel").innerText;
    var isInSalesConsole = myappname.includes("Console");

        function viewRecommendation(recommendationId, recommendationName) {
            var recommendationURL = "/" + recommendationId;            
            if (isInSalesConsole) {
                var tabIconURL = "{!URLFOR($Resource.installAssets, 'img/lattice-app-tab-icon.png')}";
                sforce.console.refreshNavigationTab();   
                openOrActivateInPrimaryConsoleTab(recommendationURL, recommendationId, recommendationName, tabIconURL); // function to open new tab within console 
            } else {
                window.open(recommendationURL, '_self');
            }
        }
        
    var recommendationId = '{!$CurrentPage.parameters.recommendationId}';
    console.log('recommendationId: '+recommendationId);
    var displayName = '{!$CurrentPage.parameters.displayName}';
    console.log('displayName: '+displayName);
      window.onload = function () { 
          viewRecommendation(recommendationId, displayName);
      }      
    </script>


I still have one minor usability issue, i.e. sforce.console.refreshNavigationTab();  method reloaded the original primary tab (so the previous state of the tab is lost. We have this tab as list view with pagination, so if user has navigated to page # n he is redirected to first page). If someone knows how to go back to previous state of the tab, please let me know. I tried window.history.back() but it didn't work.


Thanks,
Pramod

Administrateur PROBIKESHOPAdministrateur PROBIKESHOP
Hello 

Thanks for your post very interessant !
Could you explain me your function for openOrActivateInPrimaryConsoleTab please ?

I have to open a new tab and pre fill some fields

Thanks in advance
Best
Thomas AstutoThomas Astuto
This may have been answered already but can you open a hyperlink inside the customer tab as a subtab and not just using the standard href targets that are listed below?

_blank - Opens in a new window.
_self - Opens in the same frame as it was clicked.
_parent - Opens in the parent frameset.
_top - Opens in the full body of the window.
 
Tiwari VedantTiwari Vedant
_self is opening new subtab in lightning console. I dont want to open link in new subtab. It should override primary subtab. The formula field is-

(" [" &
HYPERLINK("/apex/Sc_UpdateCustomerEnvironment_Update?action=Select&CaseNumid="&Id,"Select", "_self") & "]" &
" [" & HYPERLINK("/apex/Sc_UpdateCustomerEnvironment_Update?action=View&CaseNumid="&Id&"&EnvId="&CustomerEnvironment__c,"View Selected", "_self") & "]" &
" [" & HYPERLINK("/apex/Sc_UpdateCustomerEnvironment_Update?action=Edit&CaseNumid="&Id&"&EnvId="&CustomerEnvironment__c, "Edit Selected", "_self") & "]" &" [" &
HYPERLINK("/apex/Sc_UpdateCustomerEnvironment_Update?action=New&CaseNumid="&Id,"New Environment", "_self") & "]")

It is working perfect in classic console.