04 March 2014

Auto-magical things you can do with salesforce links

Ever notice how the URL in the address bar of your browser can be used to do auto-magical things in the app? 

I've been spending a lot of time in the logs looking at URLs and having to interpret what the links actually mean. But understanding the salesforce link structure opens many different doors for an admin including creating custom links, passing parameters into pages and reports, creating formula fields, bookmarking, and other general hackery.  

Below are tips and tricks to master the salesforce URL link structure. Most of the following is from Travis Bryant and Keith Torluemke who put together an incredible tip sheet that I've edited here.

All the links listed here will only work if the user has already logged in to salesforce, and the valid session id is stored as a cookie. If there is no session id, these links will not be accessible and the user will be directed to the login page.

All URLs accessed for salesforce will start with the structure https://<server>.salesforce.com/, where <server> is the particular instance of the salesforce service that the customer's organization is hosted on. For a full list of servers, you can take a look at the salesforce trust site. Example values for <server> include:

  • na1
  • na2
  • na3
  • na4
  • ap
  • emea

You can also have a custom domain name like https://salesforcehacker.my.salesforce.com using the My Domain feature. Otherwise, the first part of the address will typically be the server where your org resides.

When creating a link that will be used within the application, for instance as a Custom Link, the https://<server>.salesforce.com is not needed. All that is necessary is a relative URL which starts with a "/", as in "/015300000007epj" which could be used to access a particular record.

The next part of the URL will typically reference an object type by key prefix, such as Accounts, Contacts, Opportunities, etc... Some common object key prefixes include:

  • 001 - Accounts
  • 003 - Contacts
  • 006 - Opportunities
  • 015 - Documents
  • 500 - Cases
  • 00O - Reports
  • 00Q - Leads
  • 01Z - Dashboards
  • 701 - Campaigns

Standard objects have object key prefixes that are consistent across orgs. Custom objects have a key prefix as well, but it is based on a particular org implementation, thus custom links would most likely break upon sharing between orgs. The easiest way you can obtain a key prefix is by performing a describeSObject() on the particular object using the API (i.e. using Workbench) or with the .getKeyPrefix() method in Apex.

View Links

These URLs are used to view various screens within the application

Relative URL
App Home Page
Go to the overall home
https://na1.salesforce.com/home/home.jsp (Homepage)
View Object Home Page (Tab)
Go to the homepage for the object’s tab
/<object key prefix>
https://na1.salesforce.com/001/o (Account Home Page)
View All Objects
Go to the last list view for that object
/<object key prefix>
https://na1.salesforce.com/003 (View Contacts)
View Object/Record
Open an individual record’s detail page
(Individual Account)
Download Doc
Download a file from the doc tab
*Download Content
Download a file from Chatter Files
Mini-Page Layout View
See a minimalist view of the record
Print View
Print a page

* - When downloading content, multiple files can be downloaded as a zip. Use this syntax:


where ContentVersion ids are separated by forward slash. (Hack from crop1645 in comments below)
Edit Links

These links are used to go to edit object screens (new, edit, clone, or add related task).

Relative URL
Create New Object/Record
Go to the new record screen for that object
/<object key prefix>/e?retURL=<PreviousURL>
Edit Object/Record
Go to the edit record screen for a specific object/record
Clone Object/Record
Go to the clone record screen for that object/record
Add a Related Task
Schedule a task associated to a particular object/record
/<object key prefix>/e?retURL=<PreviousURL>&what_id=<id>
Transfer a Record
Transfer Ownership (affects sharing)

Link Structure Key:
  • <server> - Name of the salesforce instance (e.g. na1, na2, ap, emea, etc…)
  • <object key prefix> - The key prefix of the type of object (e.g. 001, 003, 005)
  • <id> - unique record id of the particular record or object including key prefix and server identification
  • <PreviousURL> - this is the relative (meaning, starting with “/” instead of the fully qualified domain name “https://na1.salesforce.com”) URL of where you’d like to return after completing the edit. This could be any of the View Links listed above. If the return link is not included, salesforce returns the homepage. Note: the use of “%2F” is code for the character “/”, which is needed to create the return link correctly.
  • what_id - this is the id that the task should be associated to, whether Account, Contact, Opportunity, etc…

Creating New Objects and Pre-Populating Fields

Using one of the Edit Links listed above, a custom link can be created which pulls data from a record and populates another record. For example, a custom link can be created from an Account page which creates a case and pre-populates some of the case fields with data from the Account record.

Relative URL
/<object key prefix>/e?retURL=<PreviousURL>&<field id1>=<value>&<field...>

Link Structure Key:
  • <object key prefix> - The key prefix of the type of object (e.g. 001, 003, 005)
  • <field id1> - this is the identifier of the field in the html of the Edit object page. To get this id, View Source of the edit object page, and search on the Field Label. The control (radio button, check box, select box, etc…) will have an id attribute. The value for this id attribute is what you need to add to the custom link. Note: be careful when viewing the source of a page as salesforce reserves the right to change the page attributes in future releases which can break automation built around those attributes.
  • <value> - this is the value you will pass into the field. This could be a literal value (e.g. “1” or “High”), or a merge field from the record you’re coming from (e.g. {!Account_Customer_Priority}).

Passing Parameters to a Report

Using a custom link, a user can launch to a report and pass parameters to make the report unique.

Relative URL
/<report object id>?pv0=<par1value>&pv1=<par2value>&pv2...

Link Structure Key:
  • <report object id> - id of the specific report to run
  • pv0 - list each parameter passed to the report (e.g. pv0, pv1, pv2, etc…)
  • <par1value> - specific value for the parameter, which could be a merge field (e.g. {!Account_Name}).

Understanding the salesforce URL link structure can open doors to salesforce customizations. Don't be afraid to experiment and let me know how it goes! Happy linking!!


  1. You can also get to tasks and events in a list view format by using /00T after your org url. Example https://na14.salesforce.com/00T

  2. Going to /one/one.app will take you into Salesforce1.

  3. Regarding pre-populating fields on a 'New' page, this isn't officially supported by Salesforce (as it treats the UI as an API) and could change in ways that'll break an implementation. Having said that, there's no currently suggested alternative and if you can live with this possibility, hack away!

    See the response on this idea for more information: https://success.salesforce.com/ideaView?id=08730000000gM7mAAE

    1. Definitely agree - salesforce won't support anything that is hacked in the DOM. That's part of the fun! Develop with care and consideration!!

  4. Just found another list of uri mappings:

    Standard object based pages:

    /d: Detail- Detailing a single record and with its associated records
    /m: Hover- HoverDetail page that uses a mini layout and no header/footer
    /e: editPage Allowing the editing of a single record
    /p: printableView- In a relatively unadorned format, detailing a single record and all of its associated records. Does not have a help link, since you can't click links on paper.
    /o: Overview of a single entity.
    /l: list- A filtered list of a single entity
    /x: Printable list: A filtered list of a single entity. Does not have a help link, since you can't click links on paper.
    /r: Refresh list: A stripped down version of a list filtered by ids
    /s: special: Special is used for "other" pages where you want to reuse parts of the edit/detail page
    /h: history: Show the history (used only in forecasting)
    /a: Assign: Entity Owner Change page
    /c: calendar: Time-based (Calendar) view of list data
    /n: mini edit: Mini layout edit page

    Custom Objects based Pages

    /d: Detail
    /m: Hover
    /e : Edit
    /p: Printable View
    /o: Overview
    /l: List
    /x: Printable List
    /a: Assign
    /r: Refresh List

  5. In the category of Reports URLs, don't forget "pc" and "pn" to use with "pv".

    pc0 for the first field
    pn0 for the first operator
    pv0 for the first value

    Operator values are eq, ne, lt, le, gt, ge, co, nc, sw and in

  6. Any ideas how to hack a related list? So for example, i have a contact John Smith, who has a related list called 'Associations' he is part of A, B & C associations, i want to create a report that shows all the other contacts part of A B & C to be called from a button on Johns Contact page. How do i incorporate the related list details? Thanks Julie

    1. Hi Julie,

      Hacking a related list from a URL hack and not really recommended from a screen scraping standpoint. If you're traversing relationships between objects including records that may be off-screen (A, B, C, D, E, and F are available but G, H, I, J, K, and L are not visible on the screen but valid associations), you really should consider Apex instead of pushing the URL hack imho...

  7. This comment has been removed by the author.

  8. Hello - When passing parameters into a report. Is there anyway to conditionally pass the parameters so that they only populate if the specific field on the SFDC object is populated?

    IE I have 4 fields. The first 2 will always be populated. 3 and 4 might not be populated. I only want to pass values from 3 and 4 into the report if they are populated. Can I use an IF statement (or something similar) in the link to conditionally pass parameters into the report Report (based on the field being populated)? Or any other trick to do this?


  9. Sorry not sure if the above is clear enough.

    To be clear I only want to include fields 3 and 4 in the filter criteria of the report if they are populated. Currently if they are blank the report is not exactly correct because it only pulls records where Fields 3 and 4 are null. If the fields are null on the object I would like to not include them in the report criteria.

    Is this possible?


    1. I don't think this is possible but I'll do some digging.

    2. Hey thanks for the reply Adam. I think I actually got it to work with a nested if statement that spits out the correct report ID. I did have to create one report for each scenario (of fields that are populated) but I think I got it working. As long as the report does not include pv5 for example then the link can not try to pass anything into that filter. Syntax Below. Good times!

      /{!IF(ISPICKVAL(Reference_Request__c.X2nd_Priority_Talking_Point__c,'')&&(ISPICKVAL( Reference_Request__c.X3rd_Priority_Talking_Point__c,'')),'00Oe0000000GoHV',IF(ISPICKVAL(Reference_Request__c.X3rd_Priority_Talking_Point__c,''),'00Oe0000000GoHG', '00Oa0000008eyO7'))}

  10. Hi Adam, thanks for this page.

    How would you pass a parameter for the print url in visualforce?
    For example I have custom list page in VF that I want to display a printable view link for -

  11. Hi Adam, thanks for this page.

    How would you pass a parameter for the print url in visualforce?
    For example I have custom list page in VF that I want to display a printable view link for -

    1. https://developer.salesforce.com/page/Visualforce_Extended_Print_Preview

  12. Hi Adam,
    I would like to Edit the Task
    Can you Post me URL to Edit the Task

  13. Hi, Is it possible when sharing a link to a file on Salesforce that the file auto opens/plays instead of asking the user to download?

    1. Hi Tammy,

      Thanks for reading the blog!

      There is a preview function for certain file types like powerpoint and PDF. However, if the file extension is questionable or unknown, you only get the prompt to download I believe.



  14. Adam, you can add to the table under Download Content that multiple files can be downloaded as a zip. Use this syntax:


    That is, ContentVersion ids separated by forward slash. I've tested this and been able to get some pretty big zip files before I got tired of waiting for a response (~400 MB)

    1. crop1645 - that's an awesome hack!!!!

    2. Can we change the downloaded zip file name instead of 'downloaded-content.zip'?

  15. p/share/AccSharingDetail?parentId= will give you the visibility reason of a record in case you get a permission denied error.

  16. I'm looking for ID= as described and I'm finding things that are different from what is above. For example, if I look at a field on two contact records I see ID=
    ...which are not consistent and don't fit the pattern above.

    Am I looking at the wrong ID or what?

    Thanks... Bob

  17. Hi there ! Great content...
    Anyone succeeded in Hacking URL to filter a dashboard ?
    Have a dashboard that can be filtered ... but hit the limit of number of filter values, was hoping we could hack the url to pass the filters as parameters... Anyone ? Thanks

    1. I've never seen that done I'd be curious to find out if someone figured out how to do it

  18. can anybody help me how to pass parameter to chatter tab? Actually I want to open chatter tab from custom button on contact record. I know how to do that. But I also want message input box to be auto-populated with @mention tag from parameter.

  19. Useful information shared..I am very happy to read this article..thanks for giving us nice info.Fantastic walk-through. I appreciate this post. Cast Steel

  20. The key here is to make your link velocity look natural or in other words you shouldn't get 10000 links one month then 100 then next month.shorten hyperlink

  21. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. https://dieseltester-cn.com/diesel-injection-test-equipment-fuel-pump-tester-12psb-c/

  22. There are ordinarily three sorts of magic spells: white magic spells, dark magic spells and love magic spells. playing card tricks

  23. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. auto repair Freehold NJ

  24. I essentially discovered your site page and expected that would state that I have truly respected the experience of looking on the web diary sections. paintless dent repair

  25. You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. auto repair Freehold NJ

  26. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also. energy drink shopping

  27. Adam, I want multiple files can be downloaded as a zip. The syntax works fine -


    But I want to rename the zip file. So, whats the param do I need to paas for this?

    1. Also want to mention that whenever I dowload the zip file, it shows a default name 'downloaded-content'. I want to rename it by passing a parameter. How to do that?

  28. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!. 50 likes

  29. Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share. https://autopartsgh.com/

  30. I as of late went over your site and have been perusing along. I thought I would leave my first remark. .I don't recognize what to say with the exception of that I have delighted in perusing. Decent blog, I will continue going by this online journal all the time.

  31. Detective and hacking services. We offer our services in solving complex issues.

    Check treason.
    Help in business.
    Collection of information.
    Hacker services
    Hacking social networks
    Opening Crimes.
    The search for hiding.
    Search for the missing.
    Information that interests you.
    Help in resolving conflicts.
    Collection of compromising information, detailed information.
    Performance of work according to the plan of the customer.
    Any tasks are discussed.
    Prices for services are minimal.
    We work for the result.

    We carry out all types of detective services, we do it efficiently. Consultations are free.
    We select an individual type of assistance and make discounts for regular customers.
    We work around the clock.

    Hacking service: Hacking WhatsApp, Hacking Facebook, Hacking Snapchat, Hacking Instagram, Hack E-mail ang others

    WhatsApp:+1 581-703-2052
    Site: https://private-service.best/
    E-mail: private.service.best@gmail.com

    The Best!

  32. it tends to be difficult to get your auto to the shop so this is the point at which a versatile auto fix professional is totally fundamental so as to set aside time and cash. best reviews of car accessories

  33. Automobile" has its inceptions in Greek and Latin and it has become a basic aspect of each man's life. It has become so imperative that on a normal, an individual goes through at any rate 3 hours in his vehicle consistently. best reviews of car accessories

  34. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. auto czesci szczecin

  35. Starting an Cash Discount shop can be very profitable, but a shiny complete shop full of new equipment can be out of the reach of most auto repair business entrepreneurs. The cost of a business startup can deter many of us from starting a new auto repair shop now.

  36. Thank you a lot for sharing this with all of us you really recognize what you are talking about! Bookmarked. Kindly additionally seek advice from my web site =). We may have a hyperlink trade contract among us! Mega888

  37. Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! oregon classic auto glass

  38. I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys. ey said

  39. Is it true that you are looking for better auto protection rates? Is it true that you are burnt out on inclination like you're overpaying regardless of your unblemished driving record? reinsurance

  40. https://www.cprautoglassrepair.com It is basic for things like hail, street flotsam and jetsam, rocks and different things to fly into your windshield causing harm. These things regularly cause chip or breaks and it could be important to have the windshield fixed to hold further harm back from occurring just as guard the driver and traveler. In the event that the harm is adequately serious, you may need to absolutely supplant the windshield.

  41. Acknowledges for penmanship such a worthy column, I stumbled beside your blog besides predict a handful advise. I want your tone of manuscript... 2020 Keystone RV Fuzion 410

  42. Mmm.. estimable to be here in your report or notify, whatever, I repute I should moreover process strong for my have website want I play some salubrious further updated busy in your location. 2021 Winnebago Micro Minnie 2306BHS

  43. Your auto glass is quite possibly the most noticeable pieces of your vehicle. Along these lines, individuals will see if the glass is damaged, in any event, when just a bit. Supplanting the whole glass is the arrangement that individuals as a rule take when they discover breaks or scratches on their windshield.this website

  44. Pallet pooling is a great way for companies to save both money and effort when transporting their goods. Instead of having to manage and maintain their own fleet of pallets, they can simply hire them for the period needed and hand them back afterwards. By doing this the company can then focus one hundred percent on their main business, instead of having to divert money, time and space to running their distribution arm instead. plastic pallet

  45. Cops are approved to pull you over in the event that they see that there is an issue with your windshield. The windshield shouldn't be seriously harmed for them to do this. A long, running break or a little round bullseye is sufficient to draw their consideration and acquire a fine for you. service auto glass