0

BACKGROUND

Run into an issue implementing the answer to this question, How to recreate Contact, Account, & Opportunity homepages with Visualforce pages? - that being:

There appears to be a "bug" with this approach, though it's not a deal breaker for me; meaning I still plan to use this approach in part because as a result of the bug being present on 100% of the tabs displayed, it's less noticeable. So, bug is that the "real" accounts tab, which is hidden, is the tab that's shown as being active, even though it's not; meaning if you have the real & custom tabs displayed, click the custom tab, the real tab is highlighted as being selected even though it is not. Played around with both the code, tab-names, etc. and nothing appears to fix this.

eyescream was kind enough to reply my comment saying:

I thought you were going to override the standard tab with this? Go to Setup > Accounts > Buttons, Links and Actions and hit "Edit" next to "Tab". Change the code to (no std controller specified) and it should become selectable. If you still need server-side checks - just use regular controller and not an extension class.

Thing is there appears to be a few issues, first issue being that I'm unable to get it to work, and the next being that it appears there's some code in the "Setup > Build > Customize > [Accounts,Contacts,Opportunities] > Buttons, Links, and Actions" that is from the Nonprofit Starter Pack. As such, give these appears to be more of a new question, than a request for clarification, and it's likely that you seeing what I'm seeing would be of use, I've posted a new question.

Efforts Made

(1) Updated the Visualforce code for the custom contact tab/page by replacing <apex:page standardController="Account" readonly="true"> with <apex:page readonly="true" tabStyle="Contact">

enter image description here

Here's the text version of the code above if it's of use:

<apex:page readonly="true" tabStyle="Contact">
    <apex:sectionHeader title="{!$objectType.Contact.LabelPlural}" subtitle="Home"/>
    <apex:ListViews type="Contact" />
</apex:page>

(2) Modified the contact tab configs here, "Setup > Build > Customize > Contacts > Buttons, Links, and Actions" by selecting "Override With: Visualforce page", selecting the related Visualforce page, and saving the change:

enter image description here

(3) Moved the custom tab next to the default tab and tested to see if the bug was fixed by clicking the home tab, then the custom tab; the result was that the page for the custom tab was displayed, but the tab for the default contact page was highlighted.

Here's a pic of what I'm seeing, the default contact tab is on the left, and the custom contact page tab is on the right: enter image description here

Nonprofit Starter Pack Customizations

As mentioned above, there are some Nonprofit Starter Pack (which are managed packages from the Salesforce Foundation) listed within the over item in "Setup > Build > Customize > Contacts > Buttons, Links, and Actions" but the default-tab-override item was set to the default, so I'm guessing that the other code is unrelated to the current issue of me attempt to override the default-contact-tab. Happy to post the code if it's of use.

  • 1
    Wait, so you have both overridden Contacts tab and the Custom tab made out of VF? I don't think you need both. Verify that going to real contacts tab (/003/o) displays your VF page and if it does - delete the custom tab? – eyescream May 24 '14 at 20:18
  • +1 Great, thanks, works now; please post that as an answer, and I'll upvote & select it as the answer too. Also, just a heads up that you've got to change the VF code first, or at least for me, the VF code does not show of in the dropdown options under "Override With: Visualforce page" on the default-tab customization options. – blunders May 24 '14 at 20:30
  • 1
    To be honest I don't think this answer deserves any reputation ;) I'd feel wrong getting more points that way, it already looks suspicious, like I'm your exclusive answerer ;) Not sure what you've changed that it's not a valid override anymore. Update the Q maybe? Also - if you'll ever need an Admin-like backdoor to the original tab - use link similar to /003/o?nooverride=1 (I keep some of my utility links in home page component that's visible only for SysAdmins). – eyescream May 24 '14 at 20:51
  • 1
    Post your own answer and accept it so it goes "off the radar"? We need to improve our ratio of answered question, this site is in beta far too long :) – eyescream May 24 '14 at 21:02
  • 1
    My understanding is that SE already decided to move SF.SE out of beta, but agree that there's zero reason for SF.SE to be in beta; this based on dealing with 10+ betas, some of which are now toast; SE is slow, so don't think it reflects SE opinion of the site. Any rate, posted an answer below, and will accept it after the two-day waiting period for self answered questions expires. Again, thanks! – blunders May 24 '14 at 21:18
1

Per eyescream's request, I'm posting his answer left in the comments above here:

Wait, so you have both overridden Contacts tab and the Custom tab made out of VF? I don't think you need both. Verify that going to real contacts tab (/003/o) displays your VF page and if it does - delete the custom tab?

I've verified this was the issue, and that that his additional suggestion works too, that being:

If you'll ever need an Admin-like backdoor to the original tab - use link similar to /003/o?nooverride=1 (I keep some of my utility links in home page component that's visible only for SysAdmins).

Worth noting that I tested the above on non-sysadmin user, and the user is able to view the default page if they know the parameters to pass in the URL; which makes sense.

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.