Salesforce URL Explained

Posted March 30th @ 11:55 pm by Darren

Advertisement

This is the second part to the tutorial I presented last week about Automatically filling in the Account Name when entering the Opportunity Name. This tutorial will go into a little detail about the structure of a Salesforce URL and I’ll explain the code that we used last time.

Let’s get started, first you need to understand how the URL works.

The Basic Breakdown

First click the Opportunity tab. You get to the Opportunity Home page and the URL should look something like this:

https://na3.salesforce.com/006/o

So let’s dissect this. The na3 in the URL is the Salesforce server that hosts your application for your org. In this case, na3 means North America 3. The /006 is an ID for the object that you clicked. In this case 006 is the ID for the Opportunity object. The /o just means object home page. So altogether you have a URL that says “take me to the Object Home page for object 006″. If you change that 006 to 001 and hit enter, you should get to the Account Home page.

Introducing Parameters

Go back to the Opportunity Home Page and click new. The URL should now look like:

https://na3.salesforce.com/006/e?retURL=%2F006%2Fo

Now this is the exact same URL as before with a few changes. Notice you should still be on the same server and Object ID is still 006. But now instead of /006/o we have /006/e. The e means edit and that’s why you’re on the Opportunity Edit page. The ? is a standard way to denote the beginning of parameters in a URL. Notice the retURL parameter is set to %2F006%2Fo. The retURL parameter tells the application where to direct the user when they click ‘Cancel’ or ‘Save’. In this case %2F006%2Fo is a placeholder for the Opportunity Home Page. If you set the retURL to a specific record ID you will return to that record when you finish editing.

Add this to the end of the URL and press enter:

&opp3=Warrior Point -

salesforceopp3.jpg

Observe the Opportunity Name field. In general you can pass many parameters after the ? (question mark). It’s pretty straight forward. You specify the parameter name equal to some value. And each name/value pair is separated with an & (ampersand). In general it looks like this:

/006/e?param1=value1&param2=value2&param3=value3 …

Most standard and custom fields on any object can be pre-filled using a URL parameter. You just need to figure out the corresponding parameter name. In this case, the parameter opp3 corresponds to the field for Opportunity Name. For instructions on how to find the parameter name of a field visit: Decoding Salesforce.

Our Example

I used this exact technique when creating that ‘New’ button from our last tutorial.

Recall the formula we used for the ‘New’ button:

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

As you can see these are the parameters that we set:

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

Let’s go through each in detail:

retURL: We set this parameter as the Contact Record ID or if that’s null, the Account Record ID. This will take us back to the right Account or Contact record after we create the Opportunity.
accid This is the parameter for the Account field on an Opportunity. This is a lookup field so notice it has to be an Account ID and not Account Name.
conid By setting this parameter, the contact is designated as the primary contact in the contact roles of the Opportunity.
opp6 This parameter sets the Lead Source field in the Opportunity. We’ll set the Lead Source equal to the Lead Source on the contact. That’s the standard behaviour right now.
lookupcmpgn This is just a flag. When we set it to 1, Salesforce assigns the latest campaign from the Campaign History of the Contact to the Campaign field on the Opportunity.
opp3 This is where our trick kicks in. opp3 is the parameter for the Opportunity Name field. We automatically merge the Account Name and a hyphen into the name.

That’s basically the trick. We’re setting that Opportunity Name field through the URL. After the you implement the New button try it out and check out the URL. You’ll notice the Account Name is actually embedded into the URL.

Small Note: Some of you may be wondering why we don’t need the “na3.salesforce.com” in the URL formula. We’re using relative links and that basically means that the server and domain doesn’t change. In fact your browser will fill in that information automatically. I recommend using relative links in a formula. If Salesforce.com ever moved your organization on to a different server (from na3 to na2) then all the buttons and links you create won’t work.

More Uses of this Trick

This an incredibly helpful trick. You can merge information into fields and pass it through the URL just like I did. I’ll give you another scenario in which I used this trick. Let’s say you have a Sales Order object. A Sales Order is a child object to Account. So if you want the Sales Order to automatically ‘inherit’ information from the Account you can replace the ‘New’ button much the same way I did. For example, you may want the Order to be automatically pre-filled with the Account address whenever you create a new Sales Order.

Stay tuned, I have one more way in which this trick can be used.

Advertisement


-->

1 Trackbacks/Pingbacks

  1. Pingback: Auto Fill Opportunity Name with Account Name | Warrior Point - Latest News on SaaS & Tutorials for On-demand Software on March 31, 2008

11 Comments

  1. Tanner
    August 5, 2008 at 15:19

    Hi, first off I wanted to thank you for a great tutorial. I am able to find standard and custom field IDs via:http://salesforce.phollaio.com/2007/04/02/how_to_obtain_a_field_id/

    What I would like to really know is if there is an documentation for additional paremeters such as: conid, accid, lookupcmpgn? Where can these be found? I would love to be able to setup a specific contact role for an opportunity in addition to just setting the Contact Role as primary via: conid.

    Thanks!

  2. Darren
    August 7, 2008 at 00:54

    Hi Tanner,

    Thanks for the comment.

    Just thinking off the top of my head … I don’t think that’s possible.

    Those Contact Roles are almost an object in itself. I’ll have to do some more playing around to confirm but I think that scenario you mentioned is too complex.

    You might be limited to just using the conid.

  3. Albert
    October 2, 2008 at 15:23

    Thanks so very much for taking your time to create this very useful and informative site. I have learned a lot from your site. Thanks!!4

  4. Special Man
    May 13, 2009 at 07:41

    Hi!

    How to overcome issue if you have special characters e.g. é, ó, á etc. in a SFDC field ?

    Then for example my url would be:
    /006/e?param1=válúe1

    This passes ok to the corresponding SFDC picklist field with Firefox, but IE it does not pass. I have tried to URL encode the values but with no success…

    any help?

  5. Kerri OConnor
    May 18, 2010 at 15:20

    This is a great tutorial. What I am looking for is how to have a formula on one page that references another object as a hyperlink. I thought the retURL was the correct function but now I am not sure based on your explanation. Can you provide some suggestions?

    Thanks — Kerri

  6. Jack
    June 4, 2010 at 15:47

    What is the Send Notification Email Field Id? Where is the official Salesforce.com documentation for this located?

  7. guillermo
    August 31, 2010 at 17:51

    If i want to return to the last location I was in, how would i go about doing that? I want to make a dynamic link for reports, when they click on the link it goes into the line item opportunity in the edit view, once they hit save, I need to take the user back to the report details. I will use this in multiple reports, so I dont want to take the user back to the same report each time. Is there a way to do this?

  8. guillermo
    August 31, 2010 at 17:57

    @Jack,
    you may find this helpful:
    http://salesforce.phollaio.com/?s=returl&x=0&y=0

  9. Caroline
    July 9, 2011 at 19:31

    Thanks for this great tutorial. This, plus the link to the Decoding SF page for the field parameters, plus a blog post about referencing lookup fields in custom links ( http://www.interactiveties.com/b_button_override.php ) has just helped me create a custom button that my clients will love:-) Salesforce community is so great at sharing knowledge and I really appreciate it!!!

  10. Lizz
    September 8, 2011 at 17:36

    I’ve implemented this and I thank you. What if I want the user to be directed to the Record Type selection page instead of the New Opportunity Edit page?

    I have the URL, but am unsure which part of it to include in the formula.

    Thanks,
    Lizz

  11. Sol
    November 12, 2011 at 11:11

    Huge follower of the page, a bunch of your articles have really helped me out. Looking towards improvements!

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