2

So I ran into some weird behaviours trying to migrate a customer to Lightning Console. They have lots of Apex and Visualforce and our scope of work is limited enough that we want to keep any VF that works if it only requires little to no modification.

But here is a weird edge case. I think I have hit a platform bug but I'm wondering if anyone else has seen this or can reproduce it. The basics:

  • A record is opened in Subtab 1.
  • Click a button on the page layout that opens a Visualforce page in a new Subtab 2
  • The VF page has an apex:commandButton that redirects back to the original record I'd started on. This could be a {!cancel}, or any other means of redirecting to it (e.g. $Action.Opportunity.View).

The end result is, Subtab 2 redirects to the record and Subtab 1 is not closed. But the weird parts:

  • Subtab 2 cannot be closed. Click the X as many times as you want to. It immediately reopens and reloads.
  • Subtab 1 is inoperable. Click on it and you get an empty screen.

I'd be a lot less bothered at the duplicate tab if it didn't have these unacceptable UI glitches.

I have established that if the redirect happens from an Apex Controller returning a PageReference with setRedirect=true, then this does not happen and the behaviour is quite nice - the tab simply pops closed and Subtab 1 focuses. But this customer has a lot of Visualforce that uses declarative action buttons like this.

I have searched but not found similar bugs documented. Anyone able to find other such reports? Worthy of a bug report?

Functional example: Create the following Visualforce page

<apex:page standardController="Opportunity">
    <apex:form >
        <apex:commandButton action="{!cancel}" value="Behave badly in console"/>
    </apex:form>
</apex:page>
  • Configure a Lightning Console app so that Opportunities open as a subtab of Account.
  • Create a Button "Console Bad" on Opportunity that launches this page.
  • Add that button as a Lightning action to the Opportunity layout.
  • Now go into the Console app and open up any Opportunity with that layout.
  • Click Console Bad and it opens in a new subtab.
  • Now click the Visualforce button in the new subtab.

I end up with this: Duplicate tab And this: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.