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?

  • 3
    Can the link be made relative instead of absolute? – Mike Chale Apr 22 '13 at 13:04
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.

| improve this answer | |
  • 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 Aug 6 '16 at 15:42
4

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

Salesforce Web Integration

| improve this answer | |
  • 1
    Never knew there was so much help information available for this... nice one. – Matt Lacey Apr 23 '13 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. – Samuel De Rycke Aug 7 '16 at 19:45
  • @Samuel, I found and updated the link and added some context to my original comment. – JustAGirlyGeek Aug 8 '16 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....

| improve this answer | |
  • Does this work for non-Sites URLS, too? – Benj Apr 23 '13 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.