Salesforce Web Integration Links
Salesforce Web Integration Links
User Permissions
Administrators and users with
the “Customize Application” Best Practices
permission can create custom
links. Pass Session IDs with SSL
Session IDs should never be passed to an “http” URL. Instead, pass session IDs with a secure
Custom Link Lengths sockets layer (SSL) “https” URL. Any data that is passed to other applications hosted on the
• The link label of a custom Internet should always use SSL since it may contain sensitive customer information.
link cannot exceed 1024
characters. Use Relative Links to Salesforce.com Pages
• The link URL you enter can
When creating a custom link to a page within Salesforce.com, do not include the domain
be up to 3000 bytes. When
data is substituted for the portion of the URL. For example,
tokens in the URL, the link https://na1.salesforce.com/00Oz0000000EVpU&pv0={!Account_ID} should
may exceed 3000 bytes. Your not include https://na1.salesforce.com. Instead, use
browser may enforce
/00Oz0000000EVpU&pv0={!Account_ID}.
additional limits for the
maximum URL length.
Use Merge Fields to Pass Salesforce.com Data
You can add merge fields to a custom link to pass data from your Salesforce.com records,
user information, or company information to another website or application.
Use ampersands to pass multiple merge fields in a custom link. For example:
http://maps.yahoo.com/py/maps.py?cn={!Account_BillingCountry}&
csz={!Account_ShippingCity}+{!Account_ShippingState}+{!Account_ShippingPostalCode}+&
addr={!Account_ShippingAddress}.
© Copyright 2000-2010 salesforce.com, inc. All rights reserved. Last updated: November 19, 2010
Building Salesforce.com Custom Links
Linking to Documents
Use custom links to reference documents from any Salesforce.com record detail page:
1. Create a folder on the Documents tab to which all users have access.
2. Upload the document to that folder.
3. From the Documents tab, choose the folder and click Go.
4. Click View next to the document.
5. Copy the document’s URL from the browser. For example,
https://na1.salesforce.com/servlet/servlet.FileDownload?file=015300000000xvU.
6. Use the URL to create the custom link. Remember to omit the domain portion,
https://na1.salesforce.com.
Linking to Reports
Use custom links to run reports with filtered results from any Salesforce.com record detail page.
For example, if you frequently run a mailing list report for the contacts related to an account, create
a custom link for accounts that links directly to a report that is automatically filtered to the account
you are viewing. To do this, your custom link needs to pass the account’s unique record ID to the
report.
1. First, you will need an ID for the type of record by which you want to filter your report (in this
example, an account). View any record of the right type and copy the 15 character ID from the
last part of the URL. For example, https://na1.salesforce.com/001200030012j3J.
2. From the Reports tab, create the report you want by either customizing a standard report or
creating a new custom report.
3. On the Select Criteria page of the wizard, filter the report by the record ID you previously
copied. For example, “Account ID equals 001200030012j3J”. See the sidebar on the left for
tips on setting other report options.
4. Run the report to verify that it contains the data you expect.
5. Click Customize and navigate to the Select Criteria page of the wizard.
6. Delete the record ID from the report filter, but leave the field and operator values intact. Note
the order of your filter, for example, first, second, third, etc.
7. Click Save or Save As to save the report to a public folder accessible by the appropriate users.
Save does not create a new custom report, whereas Save As does.
8. Run the report and copy the report’s URL from the browser.
2
Building Salesforce.com Custom Links
9. Begin creating your custom link. In the Link URL field, paste the report URL you copied.
Remember to omit the domain portion, https://na1.salesforce.com.
10. At the end of the URL add the following text: ?pv0=. Use pv0 if your filter is in the first position,
pv1 if second, pv2 if third, and so on. Then use the merge field drop-down lists to add the
appropriate ID merge field (in this example, {!Account_ID}). For example,
/00O30000000dS8u?pv0={!Account_ID}.
11. Add the custom link to the appropriate page layouts.
12. Verify that the new custom link works correctly.
Copy the URL from the address bar of your Web browser. For example:
https://na1.salesforce.com/003/e?retURL=%2F001D0000003qFmB&
accid=001D0000003qFmB
In your browser, view the source of the contract edit page. In Internet Explorer, select View
➤ Source; in Mozilla Firefox, select View ➤ Page Source.
Search the page source for the label of the fields you want to pre-populate. For example, to
pre-populate the Contract Term field on contracts, search for “Contract Term.”
For each field, locate the relevant <input> tag—usually within the immediate <td> (table
cell) tag. Copy the text after name=. For example, from <input name="ctrc40"/>, copy
ctrc40. See the sidebar for more information about these field names.
Save the information you obtained in Steps 2 and 5 above for later use.
3
Building Salesforce.com Custom Links
Click Your Name ➤ Setup ➤ Customize ➤ Accounts ➤ Buttons and Links to begin
creating your custom link. Name the new link appropriately, such as “New 12–Month
Contract.” In the field entry area, paste the URL you copied in Step 2 above. Remember to
omit the domain portion, https://na1.salesforce.com.
Delete the 15-character ID from the URL after “acc_id”. Use the merge field drop-down
lists to add the appropriate ID merge field. For example, {!Account_ID}.
Insert the link parameters using the following syntax: “&{field input name}=desired
field value.” For example, the following link sets the contract term to 12 months with a
start date of today:
/800/e?retURL=%2F001D0000003pmTi&accid={!Account.Id}&
ctrc40=12&ctrc5={!Today}
Single Sign-On
Use custom links to pass a session ID to support Single Sign-On (SSO), so users can avoid
multiple logins to web applications that your organization hosts to manage Force.com data.
To do this, construct your custom link to pass the {!User_Session_ID} merge field. This
allows users to access all authorized resources during a single authentication. External systems
can access Salesforce.com resources using a web service, which allows organizations to
communicate data without intimate knowledge of each other's IT systems behind a firewall.
<script language="JavaScript">
function redirect() {
parent.frames.location.replace("<REGULAR_WIL>")
}
redirect();
</script>