How do I close a tab on Save in the Service console, but redirect the user when in Sales Cloud?
Specifically, when a user clicks a button from a related list in the Case page, I walk them through a wizard. When that wizard is done, I want the user's experience to be "finished", whatever that means. "Finished" in Sales Cloud means that they are back at the Case page. "Finished" in Service Console means that the subtab is closed, and they are looking at the Details subtab.
I have tried
onclick, but that happens too soon. I have tried
oncomplete, but that only happens on AJAX calls. This code is quite fragile and now is not the time for a refactor. I would love an Apex or VF method that mirrors
sforce.console.isInConsole(), but I cannot find that.
How do I make this happen?