• Home
  • About
    • Leadership
    • Partners
    • Blogroll
  • Force-Squared Blog
    • Tips and Tricks
    • Configuration
    • Development
  • Support
    • Knowledge Base
    • Submit a Case
  • Is It Dreamforce Yet?

X-Squared On Demand

Salesforce solutions delivered

  • Home
  • About
    • Leadership
    • Partners
    • Blogroll
  • Force-Squared Blog
    • Tips and Tricks
    • Configuration
    • Development
  • Support
    • Knowledge Base
    • Submit a Case
  • Is It Dreamforce Yet?
  • Tips and Tricks
  • Configuration
  • Development
You are here: Home / Salesforce CRM / Development / Activities Tabs – Enhanced View and One Set of Tabs

Activities Tabs – Enhanced View and One Set of Tabs

August 14, 2008 by David Schach 7 Comments

What was I thinking? Using something as complicated as a hijacked (from the Console) Task view was bound to have problems when creating an Activities tab.

Let’s restate our goals:

  1. Create a tab that will show Activities, using the Enhanced Lists view.
  2. Don’t have two rows of tabs at the top of the page.

Question: Is there any way to make a view and to specify that we don’t want to see the Sidebar AND the Tabs?

Answer: YES. The answer is Visualforce!

We will use Visualforce’s iframe tag to fool the UI into thinking that it’s displaying a URL other than the one it thinks it’s displaying.

Step 1: Enable Developer mode. Then create a Visualforce page. I called mine Activities, so the URL is [instance]/apex/Activities

<apex:page standardController="Event" tabStyle="Event" sidebar="false" showHeader="false" name="Activities" label="Activities">
<apex:stylesheet value="/dCSS/Theme2/default/common.css"/>
<apex:panelGrid width="100%" columns="1" id="exitLink" bgcolor="#EFEFEF">
<apex:outputLink value="/home/home.jsp" id="homeLink">Exit this view</apex:outputLink>
</apex:panelGrid>
 <apex:iframe src="/007" height="900px" scrolling="true" id="theIframe"/>
</apex:page>

Notes on the code:

  • If you remove the height tag, it defaults to 100%, but that’s in relation to the number of rows in your list. So the Sidebar may be cut off if you have too few rows. Stick with a standard height. I chose 900 because I assume that most screens are 1280×1024 resolution, minimum.
  • I used 007 (the object ID for Activities), but I could have used 00T (Tasks).
  • If you click on anything in the page, the URL will remain /apex/Activities. This is because you are technically working within an IFrame. This is the reason for the Exit link.
  • The code calls the standard stylesheet so that it comes up in Salesforce’s preferred Arial font instead of Times New Roman.
  • I created a table with one column for the Exit link so that I could color the background of the link the same as the top of a Salesforce page; this is purely for cosmetic reasons.

Now we’ll create a Visualforce Tab:

Setup -> Create -> Tab
Scroll to the bottom of the page
New Visualforce Tab
Select the Activities page from the picklist
Name: Activities
Label: Activities
Choose an icon (I liked the whistle) but keep in mind that it doesn’t matter because we’re using the Events controller, so the page will have the Events green color.
Finish the wizard, and you’re done!

Here are my favorite parts of the setup:

  • It uses Visualforce.
  • A standard controller means no Apex classes are required.
  • The code can be used in any org as-is.
  • We use a full-sized IFrame to fool the Visualforce page into thinking that it’s displaying something other than a fully customized VF view!

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to email a link to a friend (Opens in new window) Email

Related

Filed Under: Development, Salesforce Tagged With: Force.com Platform, Visualforce

← Zipcar: CaaS (Car as a Service) Convert between Business and Person Accounts (B2B – B2C) →

Comments

  1. frasuy says

    August 23, 2008 at 23:58

    Nice solution. Having the Activities list view exposed is so much better than being buried in the calendaring component on the Home tab.

    Do you know if there is a way to accomplish the same thing without the iframe? Having the dual sidebars to navigate up and down on the page is ok but not great from a user experience.

    Thoughts?

    Reply
  2. David Schach says

    August 24, 2008 at 13:21

    Great request! In fact, I finished up a pure VF Tasks page a few days ago. Stay tuned for the code. After I’ve done that, I’ll create and publish an Events page as well.

    Reply
  3. stanleyh says

    August 25, 2008 at 13:30

    Seems two issues for my use: 1. From the “customer home”, if I click “Account”, the URL is not like normal; 2. Then, from “Account”, if I click “Home”, it go back to normal View, instead of your Activity view.

    Thanks for sharing!

    Reply
  4. David Schach says

    August 25, 2008 at 20:43

    Yes, this is true. Please keep checking back – we’ll have the pure VF code up as soon as possible.

    Reply
  5. James says

    October 21, 2009 at 09:35

    Just Create a VF page with a meta redirect to “/007” this will elimiate any iframe needed.

    Reply
    • David Schach says

      October 23, 2009 at 15:10

      That is true now, but when the post was written, Event & Task did not support enhanced list views.

      Reply
  6. Manish Panchal says

    August 12, 2010 at 02:37

    Nice solution friend. Great Thanks.

    Reply

Share Your ThoughtsCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Is it Dreamforce Yet?

Find out!

Find us on the AppExchange

Mass Update Contacts 2.0

Get It Now

Recent Posts

  • Prevent Duplicate Emails on Leads
  • Duplicate Record Item Enrichment and Auto-Deletion Code
  • Lightning Component With Running User Information
  • ChatterBINGO is Now Open-Source
  • Display Only My Role’s Records on a Report

Post Categories

Popular Tags

#df09 #df10 Akismet Apex AppBuilder AppExchange Appirio Astadia Blogs Chatter Configuration Content DreamFactory Dreamforce Eclipse IDE Enterprise Force.com Builder Force.com Platform Google Infowelders Integration Just for fun Lightning New Developments New Features Partner Program PersonAccount Projects Publisher Salesforce Salesforce1 Salesforce for Google Apps sfdcverse Sites Visualforce Web-to X-Squared On Demand

Find Us Online

  • Twitter
  • Facebook
  • LinkedIn
  • RSS

Subscribe

RSS Feed Comments

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 164 other subscribers

Copyright © 2008–2025 X-Squared On Demand · Genesis Framework by StudioPress · WordPress · Log in