Many a times we need to display cases on the Home page layout or Home tab of user. We can customize our Homepage by using components provided by Salesforce like calendar,tasks,custom links but unfortunately, there is no standard component for Cases which we can include in our home page layout.
There is a solution. All we need to do is to create a simple visualforce page and include it in our layout. Here is the step by step solution
STEP 1- Turn on the development mode in your Salesforce org and create a simple visualforce page which displays a list of all the cases. Here is the code:
<apex:page showHeader="false">
<apex:ListViews type="Case" />
</apex:page>
STEP 2- Create a home page component using this visualforce. You can find the steps in this post
STEP 3- Select the layout and go to your home page. it will look something like this:
However there is a crunch, if you click on a case it open it , it will be displayed like this.
There is a solution. All we need to do is to create a simple visualforce page and include it in our layout. Here is the step by step solution
STEP 1- Turn on the development mode in your Salesforce org and create a simple visualforce page which displays a list of all the cases. Here is the code:
<apex:page showHeader="false">
<apex:ListViews type="Case" />
</apex:page>
STEP 2- Create a home page component using this visualforce. You can find the steps in this post
STEP 3- Select the layout and go to your home page. it will look something like this:
Cases on Home Page Layout |
However there is a crunch, if you click on a case it open it , it will be displayed like this.
No Body would like to open a case like this right? |
Obviuosly, this is not we want. Here a simple HTML tag comes to our help the <base> tag. We need to use the tag <base target="_parent"/> in our code. This will fix the error and will redirect us to the case record page whenever we click on a record. Thus the final step will be.
STEP 4 - Go to the visualforce page we created and edit the code. The new code of the visualforce page should be:
<apex:page showHeader="false">
<base target="_parent"/>
<apex:ListViews type="Case" />
</apex:page>
Click Save. Go to your home page you will get all the cases.
If you have any question or problem in impelementing it please leave a comment or mail me at shahid2889@gmail.com.
I hope you will find this post useful.
No comments:
Post a Comment