You need to sign in to do that
Don't have an account?
Sandy Cook 1
getEnclosingPrimaryTabId: Cannot get workspace from frameId
Hi,
I've got a Custom Visualforce page which is attempting to open a tab from a link.
I'm using the standard exmaple code from https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_opensubtab.htm
However there are zero tabIDs coming back from the page so opening a new tab fails. Code looks like
<apex:column ><A HREF="#" onClick="testOpenSubtab();return false">Click here to open a new subtab</A> </apex:column> <apex:includeScript value="/support/console/42.0/integration.js"/> <script type="text/javascript"> function testOpenSubtab() { //First find the ID of the primary tab to put the new subtab in console.log(sforce.console.getFocusedPrimaryTabId(showTabId)); if(sforce.console.isInConsole()){ sforce.console.getEnclosingPrimaryTabId(openSubtab); } else { console.log('we are not in console'); } } var showTabId = function showTabId(result) { //Display the primary tab IDs console.log('1'); console.log(result.ids); console.log('2'); }; 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; console.log("primaryid" + primaryTabId); console.log(result); sforce.console.openSubtab(primaryTabId , 'http://www.salesforce.com', false, 'salesforce', null, openSuccess, 'salesforceSubtab'); }; var openSuccess = function openSuccess(result) { //Report whether we succeeded in opening the subtab console.log(result); if (result.success == true) { alert('subtab successfully opened'); } else { alert('subtab cannot be opened'); } }; </script>
The resulting console output is.
Come someone point out what I'm missing / doing wrong here?
Many thanks.
I'll answer that someway down the road.
The ability of the relationship seems to work quite well here. The example shows the link from a Task to the associated Case.
Creating something like this