Auto Fill Opportunity Name with Account Name

Posted March 19th @ 2:12 pm by Darren

Advertisement

Opportunity Name Best Practice

As a best practice, Saleseforce.com recommends that you prefix your opportunity names with the corresponding account name. Let’s say you have a sales opportunity for 50 widgets under the ABC Company account. The opportunity should be named:

“ABC Company - 50 Widgets”

This just makes it easier when you see an opportunity in a report or the recent items list. If you don’t put the account name in the opportunity name then you may end up seeing a whole bunch of opportunities that are labeled “50 Widgets”. That can cause a lot of headaches later on when you see a list of opportunity names but you can differentiate which account the opportunity belongs to. This is so important that when you convert a lead, Salesforce will automatically prepend the new opportunity name with the account name.

But the question I always get is: “How come Salesforce doesn’t do that when I create an opportunity from an account or contact record?”

I’m going to show you a little trick that I have used for a couple of customers.

Goal: Right now when you’re on an account or contact record and you click ‘New’ to create an opportunity, the opportunity name is blank and sometimes sales reps will forget to properly name the opportunity as mentioned above. With this trick we’re going to replace the ‘New’ button. This custom button will now automatically fill in account name into the opportunity name whenever you create an opportunity from an account or contact. That will ensure that all opportunities are named according to the best practice suggested by Salesforce.

Before we begin, you may want to do this during off hours so that you can test it without disruption. It will only take 5 minutes so you won’t be putting in too much OT :-)

First we need to create a new custom button on the opportunity.

  • Click Setup > Customize > Opportunities > Buttons and Links
  • Under the Custom Buttons and Links related list click ‘New’

Fill the form in with the following fields:

  • Label: New
  • Name: New
  • Display Type: List Button
  • Behavior: Display in existing window without sidebar or header
  • Content Source: URL

Copy and paste this expression into the text box and then click ‘Save’:

/006/e?retURL=%2F{!NULLVALUE(Contact.Id, Account.Id)}&accid={!Account.Id}&conid={!Contact.Id} &opp6={!Contact.LeadSource}&lookupcmpgn=1&opp3={!Account.Name} -

Click to enlarge screenshot:
Click to Enlarge

Next you’ll have to go to the account and contact page layout to swap the standard ‘New’ button with our custom made button on the opportunity related list. To do this follow these steps:

  • Click Click Setup > Customize > Accounts > Page Layout
  • Click ‘edit’ beside the page layout
  • Scroll down to the ‘Related List Section’ and double click ‘Opportunities’

A new menu should pop up. And follow these steps.

  • To make sure these changes are made on all account page layouts check each box under the ‘Other Layouts’ section (view screenshot)
  • Hide the standard ‘New’ by un-checking the box beside it
  • Under the ‘Custom Button’ section add our ‘New’ button to the selected list
  • Click ‘ok’ to close the pop up menu
  • Remember to click ’save’ on the page layout

Click to enlarge screenshot:

Click to Enlarge

Now repeat these same steps for the contact page layout. After you have done so, test it out! Open any account record and try creating a new opportunity from the related list. Then open any contact record and do the same. You should see that the opportunity name is always prefilled with the account name just the way we like it.

Don’t understand how that code works? Don’t worry, I’ll be posting a follow up to explain the details of the code.

Update:
Here is the follow up post that I promised. Click here to learn more about the code and the trick I used.

Advertisement


-->

1 Trackbacks/Pingbacks

  1. Pingback: Salesforce URL Explained | Warrior Point - Latest News on SaaS & Tutorials for On-demand Software on March 30, 2008

3 Comments

  1. Luigi Montanez
    March 19, 2008 at 20:53

    Thanks for this! I’ve thought of solutions to this very problem, but it’s never occurred to me to do it this way, which is now obvious with the benefit of hindsight. Very, very helpful.

    (btw, I don’t think your OpenID login is functioning properly)

  2. Darren
    March 27, 2008 at 19:33

    Thanks! You’re right. I’m removing the OpenID until we resolve the issue.

  3. philip
    March 7, 2011 at 16:28

    make a account on demonix.00@gmail.com your account … is wat you name it

Leave a comment

Standard Login

Options:

Colors

  • bea test
  • vince young uncle rico
  • chicago bears 96
  • tea party hobbits
  • tea party agenda
  • checkers
  • bengals youth jerseys
  • hijack
  • contactor
  • zara phillips wedding date
  • connecticut renaissance faire
  • bengals usa
  • search engines for jobs
  • search engines zuula
  • chicago bears garter
  • la ink season 6
  • zara phillips facebookzara phillips gossip
  • zara phillips guest list
  • damon
  • dist 95
  • bea 4603
  • connecticut 100 club
  • compared
  • dreamweaver
  • new england patriots underwear
  • c span kozol
  • la ink yahoo answers
  • search in vi
  • msnbc
  • tea party nj
  • chad ochocinco height and weight
  • dues
  • vince young endorsementsvince young foundation
  • mcmillan
  • bengals tryouts
  • battleship aurora
  • trademark
  • search 3 bodybuilding other index
  • chad ochocinco quits football
  • search engines visibility
  • di's hallmark
  • 1904
  • formal
  • regions
  • carrollton
  • mtv oddities
  • vince young injury
  • bengals cheerleaders tryouts 2011
  • freida pinto chanel
  • zara phillips and the queen
  • zara phillips shoes royal wedding
  • barns
  • vince young rumors
  • chad ochocinco wedding date
  • freida pinto dev
  • vince young jay cutler
  • sqlserver
  • 4pm cspancspan area 51cspan 90.1
  • connecticut state parks
  • bengals hard knocks episode 1
  • chad ochocinco to patriots
  • search engines images
  • connecticut sun
  • chad ochocinco age
  • la ink tattoos
  • achievements
  • battleship history
  • chad ochocinco bears
  • chad ochocinco yesterday
  • goto
  • search 5500
  • hp support englandhp support forum
  • battleship galactica
  • connecticut 5 star resorts
  • bengals 08 schedule
  • vince young 2008
  • randy moss university
  • bengals images
  • bengals cats for sale
  • la ink 105
  • benelli
  • search engines rankings 2011
  • chicago bears tattoos
  • connecticut post
  • chad ochocinco free agent
  • giro
  • la ink map
  • chad ochocinco yesterday
  • search engines internet
  • chicago bears 17 lisa lampanelli
  • recommended
  • hp support error 1005
  • hp support number united states
  • la ink youtube pixie
  • chicago bears 08 record
  • thinking
  • greg olsen puzzles
  • fireworks
  • c span video contest
  • hp support helpline
  • safeway
  • chicago bears 08 record
  • mortage
  • fight
  • workout
  • 1983
  • hp support center
  • connecticut natural gas
  • search cfisd.net
  • greg olsen vikingsgreg olsen wife
  • c span yesterdayc span zelaya
  • barn
  • bengals games
  • new england patriots 50
  • bea fox
  • mtv music awards
  • mtv website
  • dohc
  • c span 4 to 5
  • greyhound
  • projections
  • rico
  • bengals job fair
  • search engines 9
  • zara phillips wedding plans
  • cuties
  • vince young 99 yard video
  • courts
  • battleship bismarck wreck
  • dis windsor wi
  • tea party chicago
  • bea oracle
  • paco
  • dis quand reviendras-tu
  • mtv 90s music videos
  • search and seizure
  • randy moss 98 vikings
  • freida pinto miral
  • mtv 5 cover
  • mtv 2 schedule
  • search 2.0
  • bea karp
  • anemometer
  • chad ochocinco vs skip bayless
  • hp support contact us
  • vince young released
  • mtv true life
  • new england patriots jake locker
  • bea goldfishberg
  • battleship 3d game
  • la ink games online
  • bea luna
  • chicago bears tickets
  • freida pinto zac posen
  • battleship yamato 2010
  • chicago bears zip hoodie
  • tea party obama
  • greg olsen vancouver
  • new england patriots espn blog
  • search engines usage statistics 2010
  • bea 71 16
  • chicago bears football club
  • la ink 03x05
  • zara phillips baby
  • quartz
  • bea nipa
  • bea 71 series staples
  • randy moss jail
  • hp support venezuela
  • dis x
  • freida pinto boyfriend
  • copa
  • bea spells a lot
  • blade
  • zara phillips school
  • booster
  • wrist
  • greg olsen combine
  • vince young uncle rico gif
  • zara phillips royal wedding picture
  • zara phillips engagement ring
  • hp support repair
  • mtv overdrive
  • vince young yahoo stats
  • new england patriots 98.5
  • hp support 6500a plus
  • new england patriots store
  • search protocol host
  • greg olsen puzzles
  • dialup
  • mixed
  • greg olsen football