I have installed a flash app in my sandbox environment. Flash app will refresh the current page while performing some activity but it refreshes production environment as url(https://na7.salesforce.com/XXXXX) is hardcoded. I need to refresh the sandbox page not the production page. What would be the sandbox url?
Share
You can’t guarantee what the instance (“na7” part) of your sandboxes will be. You can ask SF support to refresh your full sandboxes to different instances (useful when one has some performance problems you can still test on another) but I doubt they can assure you “ok, your sandboxes will always land on “cs5” or something.
Your best option would be to configure the parameters passed to flash object to use relative path if possible.
So
/006...instead of fullhttps://na7.salesforce.com/006...when you’re viewing Opportunities,/apex/SomeVisualforcePageetc etc. That way URLs will work both in sandbox and production.If you don’t want to do that, you have several other methods:
Apex: check out the URL class:
Visualforce: use trick with partner URL
JavaScript – kind of last resort I think.
Piece of code that looks at the location object, for example
location.hostname.