You need to sign in to do that
Don't have an account?
apex:outputLink and Service Cloud Console
Hey folks. I'm writing a Visualforce page that will act as a custom console component in the Service Cloud Console, and I'm seeing some odd behavior when using apex:outputLink. Net-net: the outputLink tag intelligently renders differently when in the console vs outside the console (fantastic) but for some reason, the Javascript function it calls when operating *in* the console cannot be found...even if I import the Console Integration Toolkit.
Here's the VF page in question:
<apex:page standardController="Case" extensions="MyExt" showHeader="false" sidebar="false"> <script src="/support/console/28.0/integration.js" type="text/javascript"></script> <apex:pageBlock rendered="{!initiated}" title="Users"> <apex:pageBlockTable value="{!portalUsers}" var="user"> <apex:column title="Username"> <apex:outputLink value="/{!user.Id}">{!user.Username}</apex:outputLink> </apex:column> <apex:column title="Name" value="{!user.Name}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
Even when including the console toolkit js file (using both manual <script> tags and <apex:includeScript>) I get the following error when clicking on the rendered link in the console:
Timestamp: 6/23/13 6:31:29 PM Error: ReferenceError: srcUp is not defined Source File: javascript:srcUp('%2F005i0000000poJdAAI%3Fisdtp%3Dvw'); Line: 1
Any thoughts on what I may be missing?
For Console URL changes for the detail records
ui/support/servicedesk/ServiceDeskPage/?tsid=Idof therecord
I had thought of that too, but the outputLink tag is still rendering the srcUp() function automatically, which is not defined. So the code now looks like this:
But I get the same result.
Jut try
<apex:outputLink value="/ui/support/servicedesk/ServiceDeskPage?tsid={!user.Id}">{!user.Username}</
Thanks Neha. I tried that as well, with the same results.
I've run into this problem myself just now. Through experimenting I see that old-fashioned <a href=''> tags are not modified to the srcUP function and so they work as expected. I'm trying to think of a reason why this workaround might bite me in the ass... can't think of any so far.
javascript:window.open('url','_blank') for example. If you want the link to be a subtab for the console, then the following:
javascript:var openSubtab = function openSubtab(result) {
//Now that we have the primary tab ID, we can open a new subtab in it
var primaryTabId = result.id;
sforce.console.openSubtab(primaryTabId ,'url', true,
'Tab Title', null);
};
if (sforce.console.isInConsole()) {
sforce.console.getEnclosingPrimaryTabId(openSubtab);
} else {
window.open('url', '_blank');
}
THE ANSWER IS: On the VF page, set showHeader="true"
This solves mutliple problems related to srcUp when displaying a Visualforce page in a Console tab.
I'm experiencing the same issue when the page renders in Lightning. To further complicate, I cannot add showHeader="true" because I don't want the header on the page as it is displayed within a page.
I believe the solution I'm going to have to use is to not use "apex:outputLink" and just put in standard <a href> HTML tag. :(