You need to sign in to do that
Don't have an account?
xoomster
How can you tell if current session is Service Cloud console from Apex controller class?
Hi all,
Base on my code below, how can I programmatically decide whether or not the current user session is in the service cloud console?
I would like the user to be able to got to this link and have it render in console or regular; https://cs7.salesforce.com/apex/Launcher?txnID=a0AM0000004P7Se
................
Page (Page name = Launcher)
................
<apex:page controller="LauncherController" action="{!processRequest}">
</apex:page>
................
Controller
................
public class LauncherController{
private String transactionID{get;set;}
public LauncherController(){
transactionID = ApexPages.currentPage().getParameters().get('txnID');
}//end-method
public PageReference processRequest(){
PageReference pageRef;
// if console
pageRef = new PageReference('https://cs7.salesforce.com/console#%2F' + transactionID);
// else
//pageRef = new PageReference('https://cs7.salesforce.com/' + transactionID);
// end-if
if(transactionID==null){
return pageRef;
}
return pageRef;
}
}
Base on my code below, how can I programmatically decide whether or not the current user session is in the service cloud console?
I would like the user to be able to got to this link and have it render in console or regular; https://cs7.salesforce.com/apex/Launcher?txnID=a0AM0000004P7Se
................
Page (Page name = Launcher)
................
<apex:page controller="LauncherController" action="{!processRequest}">
</apex:page>
................
Controller
................
public class LauncherController{
private String transactionID{get;set;}
public LauncherController(){
transactionID = ApexPages.currentPage().getParameters().get('txnID');
}//end-method
public PageReference processRequest(){
PageReference pageRef;
// if console
pageRef = new PageReference('https://cs7.salesforce.com/console#%2F' + transactionID);
// else
//pageRef = new PageReference('https://cs7.salesforce.com/' + transactionID);
// end-if
if(transactionID==null){
return pageRef;
}
return pageRef;
}
}
Thanks,
Shailesh.
All Answers
https://cs7.salesforce.com/apex/Launcher?txnID=a0AM0000004P7Se&source=console
https://cs7.salesforce.com/apex/Launcher?txnID=a0AM0000004P7Se&source=other
Thanks,
Shailesh.
Thanks,
Shailesh.
var loc = 'https://cs7.salesforce.com/console#%2F' + txnId;
instead of
var loc = '../console#%2F' + txnId; <-- this link only opens up the home page of console.
-tony