I have a button on the case object that calls a flow via URL and the flow calls a class to update the cases OwnerID.

What I want to happen is when the Flow gets done is to close the tab that you pressed the button from. I looked at the refURL but that doesn't seem to work like I wanted to.

Here is how my Button Is Set up on the case Object enter image description here

Here is the Dropdown from a case enter image description here

  • What have you tried so far? can you post what you have done that doesn't seem to work like you wanted to! – codeyinthecloud Aug 31 '18 at 17:08
  • is it lightning or classic? – Pranay Jaiswal Aug 31 '18 at 17:09
  • This is Lightning. I have tired each one of the behaviors, but besides that I have tired different refURL. I have looked at the closeTab() function but it looks like it is only for visual force pages. – Gunner1714 Aug 31 '18 at 17:11
  • The only thing I can think of is to change it to a VF page button, embed the flow, on your VF page us JS to close the other console tab – gNerb Aug 31 '18 at 17:16
  • @gNerb Is that going to remove it from the drop down on the Case? See above added picture – Gunner1714 Aug 31 '18 at 17:42


    function testCloseTab() {
        //First find the ID of the current tab to close it

    var closeSubtab = function closeSubtab(result) {
        //Now that we have the tab ID, we can close it
        var tabId = result.id;
<script type="text/javascript">
        sforce && sforce.console && sforce.console.getEnclosingPrimaryTabId && testCloseTab();
    }, 100);


| improve this answer | |
  • Looks like you figured it out :) – gNerb Aug 31 '18 at 20:22

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.