Open Service Console tab and Salesforce Classic using JavaScript on Custom Button in Salesforce
Requirement: Need to create a custom button on detail page, when click on it open in new tab in service console apps and salesforce classic
Solutions:
if (typeof(srcSelf) == 'function') {
// This is for Console app
srcSelf('URL&isdtp=vw');
}
else {
// This is for salesforce classic
window.open('URL');
}
Notes:
isdtp=vw : this is hide sidebar in consolse app
URL = '/500/e?CF00NN0000001i1d6={!MergeFieldAPINAME}&CF00NN0000001i1d6_lkid={!MergeFieldAPINAME}&ent=Case'
In case of any issue please feel free call to me
Thanks,
Sumit Shukla
skypeID : shuklasumit1
sumitshukla.mca@gmail.com
Mob: 9711055997
Hi Sumit,
ReplyDeleteHere i wrote a javascript for custom button
if (typeof(srcSelf) == 'function'){
srcUp("/003/e","_blank");
}else{
if(sforce.console.isInConsole()){
sforce.console.openPrimaryTab(null,'/003/e', true,'Product Complain');
}
Requirement is to open this in a primary tab,but here it open in a subtab.
Can you please help me on this.