function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Duncan_StewartDuncan_Stewart 

Can a Service Console page open from an external URL?

I'm trying to replace a custom Console written in VF with just the VF search component and then direct the user into a Service Console app where they can view the Contact details and/or create/edit a Case, etc.  The VF-only console provided a search facility which then dropped you into a Case Edit detail, but now the browsers no longer allow a visual.force.com url to open a salesforce.com url within the same context.

The URL of the console detail page is straightforward, but you can only open a page in the console if you're already in the console.  Does anyone know a way around this?
Magdiel HerreraMagdiel Herrera

Have you tried using these features of the Saleforce Console Integration toolkit ?
(http://www.salesforce.com/us/developer/docs/api_console/api_console.pdf)

isInConsole()
generateConsoleUrl()
openConsoleUrl()

Vinit_KumarVinit_Kumar
I used the below code to open different links when you are inside Console or when you are outside Console :-
{!requireScript("/support/console/29.0/integration.js")} 

// If inside console
if (typeof(srcUp) == 'function') { 
sforce.console.getEnclosingPrimaryTabId(function openSubtab(result){sforce.console.openSubtab(result.id, '/apex/Mypage', true, 'Admin for {!Account.Name}');}); 
}
//Outside console 
else { 
window.open('/apex/MyPage'); 
}

Hope this helps!!

If this helps,please mark it as best answer to help others :)


Duncan_StewartDuncan_Stewart
I see how that would be useful for opening a custom page from either inside or outside the console; I'm actually trying to do the reverse - I want to create a link that will take me from outside the console inside.  I start on a VF page outside the console that provides one of more links to Contact records (in this example), and clicking those links would open the respective Contact detail pages within the Console.

So potentially the generateConsoleURL() and openConsoleURL() methods would be better.  I tried the examples for IsInConsole() and generateConsoleURL() from the Integration Toolkit Developer's Guide, but I have not been able to obtain the results of generateConsoleURL() (which I associated to a button on Case) whether I access it from inside or outside the console.

Does anyone have an example using generateConsoleURL() that's been fleshed out a bit more than the example in the Developer's Guide?

This is how I implemented it in the sandbox:

<apex:page standardController="Case">
	<apex:includeScript value="/support/console/28.0/integration.js"/>
		
		<script type="text/javascript">
		function showConsoleUrl(result) {
			alert(result.consoleUrl);
		}
		function testGenerateConsoleURL() {
			sforce.console.generateConsoleUrl(['/apex/TechSupportConsole', '/003'], showConsoleUrl); 
		}
	</script>
	<body>
	<A HREF="#" onClick="testGenerateConsoleURL();return false">
		Click here to generate a console URL</A>
	</body>
</apex:page>

Niran KanaganNiran Kanagan
have you been able to resolve this? i am in the same situation, please share your solution if you were able to resolve it.
Duncan_StewartDuncan_Stewart
This was/is in Classic, and I ended up creating a custom Service Console app, with VF sidebar components, and using a custom button to create Cases from the Contact detail. The custom button is necessary in order to make the Contact.Id available to the sidebar controllers for querying Account/Contact/Asset/custom SObjects. I'm now running into a similar issue w/ a different Service group, older custom VF console. Both of these ^ < should be recreated in Lightning at some point, but I'm not ready to do that yet.
SAKTHIVEL MSAKTHIVEL M
For Example: to open the case details in the cosole view then try it in the below approach:

Your Salesforce URL:
https://cs18.mysalesforce.com/console?tsid=02u2800000149Af#%2F500N000000CSc8j

Here:
https://cs18.mysalesforce.com/   - Salesforce URL (Production or Sandbox or Developer Org)
tsid - Your console app ID  (Setup -> Build -> Create -> Apps) click the respective apps and see the apps id in the URL.
append your case id along with "#%2F"
500N000000CSc8j - Salesforce Case ID

https://cs18.mysalesforce.com/console?tsid={Tab.Id}#%2F'+{Case.Id}

Thanks