I've received an ask to have the "Opportunity Name" standard field be pre-populated when creating a new Opportunity in the format of "Account.Name - TODAY()"; as to create a cleaner naming convention across records. The Users create the Oppty from an Action from the Account record.

I was hoping somebody could shed some light into the code that could provide this functionality, because I was unable to find of a way within standard functionality.

Thanks! Sean

EDIT: Fixed with Predefined Field values within the Custom Action

  • Do you have Lightning Experience enabled? salesforce.stackexchange.com/questions/98983/… Nov 17 '15 at 18:56
  • 1
    If you want to standardize the naming of the Opportunity, simply create a workflow rule to rename it. The users can put anything they want and your WFR will set it to the proper format....You can default it so they do not have to enter anything at all by using URL hacking but that would require you to override the New button which you may not want to do....
    – Eric
    Nov 17 '15 at 19:00
  • Yeah - I've already though of that as well. Unfortunately, they believe that the end-users won't like that solution Nov 17 '15 at 19:02
  • 1
    I JUST FIGURED IT OUT! Predefined Field values within the Custom Action is the solution. I can't believe I forgot about that. Nov 17 '15 at 19:10

You need to do Salesforce URL Hacking to Prepopulate Fields on a Standard Page Layout

You can go through the following article



  1. Create a custom button with URL hacking url.
  2. Over ride standard create opportunity button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.