+ Start a Discussion

How do I view and edit the source code of the Opportunity page?

I already have DEVELOPMENT MODE and SHOW VIEW STATE IN DEVELOPMENT MODE checked in SETUP/PERSONAL INFORMATION.  But I am unable to see and/or edit the source code of Opportunity.  What am I missing?

Any help would be very much appreciated.

Cory CowgillCory Cowgill

You cannot edit standard Salesforce pages. This includes the standard pages for Account, Contacts, Opportunity, ETC.


What can you is create a Visualforce Page and setup Salesforce to use your custom Visualforce Page instead of the standard Page.


Here is the quickstart guide which shows you how to accomplish this:



Visualforce Developer Guide homepage:



Thanks for your response.  Are you suggesting that I scrap the standard Opportunity page and create a whole new one with my custom changes?  If so, that's not an option at this point because we've invested a lot of customizations already in the Opportunity page.


My objective is to create an Excel-like grid in the Opportunity page with lookup relationship to other objects - users would populate the grid.  Can you suggest another way I could go about doing this while keeping the standard Opportunity page in play?


Thank you for your help!

Cory CowgillCory Cowgill

I understand the pain point. Its never fun to overwite the functionality of Salesforce with custom development, and you shouldn't do it unless its the only way. Overwritting a standard page with a custom page is the best practice in this scenario.


That being said, I will provide a few ideas but no gaurantee's any of these will work. Your developer or technical architect would need to play around with these to do a quick Proof of Concept to see if they'll work.


1. You can include Visualforce Page widgets inside standard Salesforce pages. I'm not sure this will work, but you could try to create a small Visualforce Page / Controller Extension which only does this specific peice of functionality and include it in the Opportunity Page Layout. When you include a Visualforce Page as a widget on a standard Salesforce page, it will actually render the component inside an IFrame which may/may not create problems for you.


2. As a last, last, last resort, if your really creative with Javascript, you can execute Javascript against the DOM on the standard edit page to add/remove elements. But I'm not even sure how you would be able to save that data when the Save button is executed. You'd probably have to execute some Javascript statements to make remote WS calls to save the data from the client side. This is also tricky because to get Javascript to execute on a standard page, you need to include the Javascript on a Homepage Component which executes onLoad() of the page.