Another Salesforce blog!!!

Salesforce, Apex

Salesforce: Service console page – opening in a sub-tab


VFP:

<apex:commandButton onclick="openTab('{!case.id}'); return false;" value="My awesome page" /> 

Javascript:

<script>

var openSecondaryTab = function openTab(objectId) 
{         
            url = '/apex/mypage'; 
            url = url+'?caseId='+objectId;
        
            if(!sforce.console.isInConsole())
                window.parent.location.replace(url );
            else
                sforce.console.getEnclosingPrimaryTabId(function(result) {
                    var recordname =name;
                    sforce.console.openSubtab(result.id, url , true, recordname,null);
                });
 }


Leave a Reply

Your email address will not be published. Required fields are marked *

*