Custom setting to determine "root URL"

  • 1
  • Idea
  • Updated 5 years ago
We've had an issue that our redirects that work in our SF environment break when we take them to the community because we have more than one community and the community name is appended to the URL.

So now we've added that community name to our redirects but the won't work when previewing in straight SF.

I am wondering if this could be managed by a custom setting that lets us specify what should be included in the root of the URL?
Photo of Thaddeus Ward

Thaddeus Ward

  • 736 Points 500 badge 2x thumb

Posted 5 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,262 Points 20k badge 2x thumb
Are you using relative links in your Redirects, e.g. "/apex/skuid__UI?page=NewApplication&id=a0600000000123", as opposed to absolute links, e.g. "https://skuid--acme--full.na12.visual..."?
Photo of Thaddeus Ward

Thaddeus Ward

  • 736 Points 500 badge 2x thumb
yes we are. The tricky bit is that in the Community Portal we need to subsitute the "Apex" bit with "Community Name". I don't think it would be a problem if we only had one community...
Photo of ktyler

ktyler

  • 9,254 Points 5k badge 2x thumb
Thad,
Maybe you could use a custom setting (which is a sort of global variable stored in your org). Your pages could build the url's and append in the value of the custom setting, in one case the setting would be "apex" and in the other "community name".

You can find custom settings under "setup/develop/custom settings".
You can add a model to a SKUID page that gets the custom setting data, just like it was from a custom object, and then refer to that model to get the value you need.
Photo of Thaddeus Ward

Thaddeus Ward

  • 736 Points 500 badge 2x thumb
Kevin, Good to know. We are about to start building out our second community and so should look at this approach.