1

Recently I came across a script to open a visualforce page in Salesforce Console and found the use of function srcUP(). Could you please let me know what exaclty does this function do and is a part of which library.

1
2

Yes SrcUp can be used to open subtabs in service cloud console.

here is an example of JS in button to open a VF page in console.

{!REQUIRESCRIPT("/support/console/30.0/integration.js")} 
if(typeof(srcUp) == 'function') //Checks that it is in console
{ 
var openSubtab = function(result){ 
sforce.console.openSubtab(result.id,'/apex/YourVFPageName?caseID={!Case.Id}&inConsole=true', true, 'Subtab Name', null); 
}; 
sforce.console.getEnclosingPrimaryTabId(openSubtab); 

} 
else{ 
window.parent.location.href=('/apex/YourVFPageName?caseID={!Case.Id}&inConsole=false') 
}

This Button code will handle opening of VF page in console and outside console very effectively.

0

srcUp is a method that allows you to open new subtabs when in the Salesforce.com domain, like “na1.salesforce.com”. Visualforce pages are served from the Visualforce domain, like “c.visual.force.com”. Visualforce pages don’t have access to the srcUp method, and hence need the Service Cloud Integration Toolkit methods to open new subtabs/ primary tabs.

Source - https://success.salesforce.com/ideaView?id=08730000000YKxYAAW

As per this SFSE link the following scripts are required.

{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")}
{!REQUIRESCRIPT("/support/console/30.0/integration.js")}

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.