Have you ever come across a scenario where you do not want your end users creating new records from the standard tab? Or you do not want them accessing the Reports and Tools sections from the standard tab page. If yes, then let me show you how you can easily accomplish this with three straightforward lines of Visualforce code.
Requirement: As a system administrator, I want the Opportunity Tab to be overridden for all profiles other than the System Administrator profile. The other profiles shouldn’t be able to create new records from the Opportunity tab and the Reports, Tools, Quarterly Summary sections shouldn’t be visible either. Reason? Our company wants the users to create Opportunities only from Accounts.
Solution: This cannot be accomplished using a point and click approach since Salesforce doesn’t allow us to customize the standard tab pages. So we will create a simple VF page and then override the Opportunity Tab with this page.
- Create a VF page with the code below:
- Navigate to Setup -> Customize -> Opportunities -> Buttons, Links & Actions, and override the Opportunities Tab with the above VF page:
And voila! With just three lines of code and a simple tab override, we were able to get the desired user experience.
Let me know in the comments below if you accomplished such a requirement in a different manner. If you are looking for a free app that lets you do this, you must look into the following: