function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Team AllCloudTeam AllCloud 

Override Standard New Button using Visualforce

Hi!

I'm trying to create a VF page to override the standard New button in order to prepopulate value in the standard Name field:
<apex:page standardController="Opportunity"
    action="{!URLFOR($Action.Opportunity.New, null, [Name='Will be Populated by the system'], true)}"
/>

Howver, it's not populated in the New layout. 
What am I missing?

Thanks!
VinayVinay (Salesforce Developers) 
why do you want to use vf page? Try using url hack to populate name field on opportunity.

Check below examples.
https://www.salesforceben.com/salesforce-url-hacking-for-lightning-tutorial/
https://jayakrishnasfdc.wordpress.com/2020/06/07/url-hacking-in-salesforce-lightning/

Please mark as Best Answer if above information was helpful.

Thanks,
Imran TMImran TM
Using a Before trigger/ Workflow has not helped me fill in or provide a default value to a standard field(NAME) while saving a new record.
I was asked to build a Visual force page and then override the 'NEW' button to add a default value to the token field, type Name, which will then allow to save a record.
Visual force page code used to override 'NEW':
<apex:page standardController="Certification__c" action="{!URLFOR($Action.Certification__c.New, NULL, ['Name'='DoNotEdit'], true)}"/>
Team AllCloudTeam AllCloud
Looks similar to my code, did that work for you?
Anand kurubaAnand kuruba
Hi,
<apex:page standardController="Certification__c" action="{!URLFOR($Action.Certification__c.New, NULL, ['Name'='DoNotEdit'], true)}"/>
please follow this link also
https://salesforce.stackexchange.com/questions/313777/conditional-override-of-new-button
Thanks!!
Santoshi K VSantoshi K V
Hi

Check out this link, it may be helpul

https://developer.salesforce.com/docs/atlas.en-us.232.0.pages.meta/pages/pages_controller_customize_override.htm

Thank you