A question asked often by salesforce.com administrators is if they can customize the page layout with labels being colored or adding anything business process help. You used to be able to add HTML to the labels but this was “fixed” by salesforce.com and no longer works (security issue, so right for salesforce.com to stop it). So no label colors. You can add help text on each field so users can hover of the field to get more info about it. This works most of the time but not all the time. Sometimes you need to write a larger process for people to follow/explain.
If you need to write a longer description or help on an objects page layout you have two choices.
- Use Flows (Visual Workflow)
- Place a Visualforce page inside your page layout
Flows work sometimes and are great. Still trying to pick up steam with the salesforce.com community. You can create wizards, per say, that will walk users through a business process. You can add info on Flows to help the users through the process.
Flows are not always the answer, though. Sometimes you just want to give some clear direction on one object to your users. Or maybe you want to explain some new fields you added to the page layout. This is where embedded Visualforce pages work well.
Do not get scared thinking you will need to be an Apex developer to do what I will show. It is a little helpful if you knew some HTML but that isn’t even necessary. The steps I am going to show are easy to follow and you don’t need to be a developer to do them.
For this tutorial we are going to write a Visualforce page explaining new fields we are adding to the Account page layout. The new fields are adding that haven’t previously been on the page layout is personal information including birthday, spouse name, date started at account, hobbies, do they like to talk personal on the phone (checkbox), and additional info. I have added Visualforce pages like this a few times, as I feel it helps users understand what you are doing as an administrator. You can remove the Visualforce page after a certain amount of time, if you want. I think by the end of this you will understand what I am meaning.
So here are the steps.
- You have created the new personal information fields but not added them to your page layout yet. You want users to understand why are we adding these fields, how they are used, and how they should be used.
- We want to write out the help/description and be able to get have it in HTML format.
- Go to Quackit’s HTML editor – http://www.quackit.com/html/online-html-editor/
- Type in whatever description/help you want. Here is an example.
- You now want to copy the actual HTML.
- Click the Source button
- Copy everything after <body> up to </body>
- Now head over to salesforce.com. I would use a new tab and keep the HTML editor tab in your browser.
- In salesforce.com go to Setup–>Develop–>Pages
- Click New
- Name the label whatever you want. In this scenario I am name it “Personal Information Description”
- Go down to the Visualforce Markup text area field.
- Delete everything in between <apex:page> and </apex:page>
- After <apex:page> paste in the HTML you copied earlier.
- Click Save
- Now go to your contact page layout: Setup–>Customize–>Contacts–>Page Layouts
- Edit one of your page layouts
- We want to add the Visualforce page to the page layout either at top or near the new fields.
- Drag the Section label somewhere into your page layout. This will hold the Visualforce page.
- Name the section whatever you want. I usually then uncheck the Detail and Edit page buttons, as I don’t want the section name showing up.
- Choose One Column
- Click Ok
- Now you want to drag the Visualforce page into the new section
- Towards the top click on Visualforce Pages
- Find your new Visualforce page and drag/drop it into your new section
- Move your mouse over the new blue area you see and click the wrench (on the right of the blue area)
- Change the height to something like 50. You can play with this until you get it the size you like.
- Save your page layout
- Now go to a contact that uses this page layout. You should see your Visualforce page inside the layout!
I hope you can now see how you can add help or descriptions easily on page layouts using Visualforce pages, all without any development.
Have fun with this and help your users at the same time.
EDIT: Thank you to Deepak K. Anand for adding his thoughts to this. You should start your Visualforce page with ObjectName“>. This will allow it to also show up on the edit page. If you leave out standardController then the Visualforce won’t show up on the edit. So you have a choice on if you want or do not want this to show up when someone edits.