5

I have a custom link in my sandbox: http://cs7.salesforce.com/00Q/e?name_salut....

However, when deploying to the production, the link is still pointing to the sandbox, while the production is at eu1 [instance]

  • off course I can make the change manually - but I will probably forget one day

  • Is there a way to build the link that will take account the instance it uses?

1
  • 3
    Can the link be made relative instead of absolute?
    – Mike Chale
    Commented Apr 22, 2013 at 13:04

3 Answers 3

9

As a best practice, you should make your links relative, you can exclude the domain "http://cs7.salesforce.com" and just use "/yourcomponent".

Not following this rule is not just an issue when deploying between different environments but also if Salesforce decides to migrate your org to another instance.

1
  • Could you please post an example of the converted URL, for example how would na5.salesforce.com/_ui/core/userprofile/… look? I've tried deleting various parts of the beginning of the URL, for a custom link but in each case, the link isn't recognized.
    – Alex S
    Commented Aug 6, 2016 at 15:42
4

This document (Building Salesforce Custom Links) might help you out:

Salesforce Web Integration

3
  • 1
    Never knew there was so much help information available for this... nice one.
    – Matt Lacey
    Commented Apr 23, 2013 at 5:14
  • Document appears to be removed. That is why it is much appreciated to add more information in an answer than an offsite reference. Commented Aug 7, 2016 at 19:45
  • @Samuel, I found and updated the link and added some context to my original comment. Commented Aug 8, 2016 at 18:33
-1

What I found to work was to use the system field:

{!$Site.CurrentSiteUrl}

at the beginning of the URL.

So the URL looks like this: {!$Site.CurrentSiteUrl}/00Q/e?name_salut....

1
  • Does this work for non-Sites URLS, too?
    – Benj
    Commented Apr 23, 2013 at 19:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .