I have design a Visual Flow in Salesforce that I have embedded in a VF page.
<apex:page sidebar="false" showHeader="false" >
<flow:interview name="Log_an_Account_Call" finishLocation="forceclose" />
</apex:page>
It opens in a new tab in the Console or in the Browser with a Custom List button on Cases.
{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")}
{!REQUIRESCRIPT("/support/console/28.0/integration.js")}
var url = '/apex/LogAccountCall';
if (sforce.console.isInConsole()) {
srcUp(url);
} else {
window.open(url,'_blank');
}
When the user click finish in the flow, I want the tab to close in the Console and in the Browser. I found the code to close in the Browser:
<apex:page showChat="false" showHeader="false" sidebar="false" applyBodyTag="false" applyHtmlTag="false">
<html>
<head>
<title>ESCAPE</title>
<script>
function closeWindow() {
window.open('','_parent','');
window.close();
}
</script>
</head>
<body onload="closeWindow()">
</body>
</html>
</apex:page>
and could not figure it out how to integrate "sforce.console.closeTab".
Any help will be very much appreciated.
Sylvie