You need to sign in to do that
Don't have an account?

Override New button with visualforce and set field values
Can I use visualforce to set default values on a standard page layout? I want to set the Opportunity Name field to a default value when the "new" button is clicked (and before the "save" button is clicked). I am not sure what the visualforce command should look like to accomplish this task. Is this possible? Does anyone have a code snippet they could share?
Thanks

Right now you can't accomplish this and still keep your page layout control. You can however override the New Opportunity page with your own visualforce page, and construct your layout using pageBlocks and inputFields. Then you can use a controller extension to set the default field in your constructor.
Code:
Code:

Thankyou!! That worked great! (my first visualforce page... I'm so exited!! :smileyhappy:)