Shipping Links

If your company ships products, a quick but high value update you can do to Salesforce as a System Administrator is add links to your page layouts to track your packages via DHL, FedEx or UPS.

Tracking Links on Page Layout

You create the links by going to the object where you would like to place the links. In our example we are using Opportunities, so you would navigate to Setup > App Setup > Customize > Opportunities > Buttons and Links, and then click the “New” button in the “Custom Buttons and Links” section on the right side of the page.

Opportunity Buttons and Links

In our example we’re selecting:

  • Display Type – “Detail Page Link”
  • Behavior – “Display in new window”
  • Content Source – “URL”

Here is the Code for DHL:{!Opportunity.Tracking_Number__c}%0D%0A

Here is the Code for FedEx:{!Opportunity.Tracking_Number__c}

Here is the Code for UPS:{!Opportunity.Tracking_Number__c}&track.x=Track

NOTE: The code that I generated for these examples were for the United States. You might have to tweak the URL string for another country.

Lastly, you’ll need to go to the page layout for that object and drag the links into the Custom Link section of the page for the new links to display.

Drag Links onto the Page Layout

That’s it!

Another method to accomplish the above would be to create a picklist next to your tracking number called “Shipping Method” so that the user could select the shipping carrier. Then you could use a Formula field (output is Text format) to create a link to the right carrier’s website based on the “Shipping Method” selected by the User. This piece of code assumes the tracking number field is called “Tracking Id”:

CASE(Shipping_Method__c,"Fedex", HYPERLINK(" "&tracking_id__c,"Track"),"UPS", HYPERLINK(" "& tracking_id__c & "&track.x=32&track.y=7″, "Track") ,"DHL", HYPERLINK("" & tracking_id__c,"Track"), "")

If you want to learn more about custom links in Salesforce you can see this tutorial about creating custom links to make dynamic reports.

This entry was posted in Administration. Bookmark the permalink.