You may wonder where the Activities tab is in Salesforce, so you can see a list view of activities. You can see the task list and calendar on the home page but what if you would like to see all of your tasks and events in a list. Well there is a way to get to a list view, but it is easy to overlook. In the calendar section on the home page, there are a number of icons that will display views of activities. The one highlighted takes you to a list view of activities.
When you click that icon, you go to a activities page that has standard views that Salesforce has created for you. You can see your own activities (tasks and events) and also your delegated activities. Delegated activities are those which you have created but have assigned to someone else.
You can also create new views. For example you may want a list of all tasks that are not complete.
But what if you want to provide access to Activity list views as a tab? To do this you will need to define a custom Visualforce page. Before you get concerned that you don’t know Visualforce, take a look at what is required for this page, it’s only 3 lines!
<strong><apex:page > <apex:enhancedList type="Activity" height="600" /> </apex:page></strong>
It is easy to understand as well. Apart from the standard <apex: page> tag that defines the start and end of the Visualforce page, the second line is the one that is does the work to display the activities list. There are 3 parts to this line:
1. enhancedList: The tag that tells Salesforce that you would like to display a list.
2. Type: This is where you select which object should be listed, in this case we are using ‘Activity’. Remember in Salesforce terms, Activity includes both Tasks and Events.
3. Height: Defines the height of the list, a value of 600 will make sure it fits into the page well.
Even though it is only 3 lines to create the Visualforce code for the page, there are a few steps to getting the page to display as a tab within your application. The complete list of steps are:
- Click on Pages
- Click on New and give it a name
- Replace the existing sample code with the code above
- Set the profiles that should be able to access this page, by clicking the Security link
- Create a Visualforce tab
- Select the Visualforce page for the tab, enter a Label, Name and tab style.
- Select the security permissions for the tab
- Select the Applications that should display the page
You should now see your activities tab. You can also customise the views as normal.