You need to sign in to do that
Don't have an account?
Depton
Get the instance URL for a Visualforce page
Hi,
I have a VisualForce page with a link:
https://na1.salesforce.com/apex/Visualforce_Page
Soon we are migrating from na1 to another instance and would like to know how to automatically retrieve the Salesforce Instance to do the same changes in all the visualforce pages.
I have tried to use relative links as in any custom link:
/apex/Visualforce_Page
but is not working
I have found this link below
Does anyone knows how should I replace
https://na1.salesforce.com/apex/Visualforce_Page
So next month with the instance change all will keep working?
Thank you
All Answers
The following code displays https://c.na7.visual.force.com/
Regards
I will check in an hour and get back to you! Thank you!!
:)
/apex/pagename should be working.. Can you let us know the problem you face.. You could also try the $Page notation..
Lastly, its not a best practice to hard code URL's unless you have no other way
It is a VF Email Template:
Here is the code:
where i have put :
yyyyyyyy is the name of the apex class...but the "here" link should open a visualforce page
and the browser opens with:
apex/yyyyyyyyy
instead of
https://cs1.salesforce.com/apex/yyyyyyyyy
Thank you for your help!
aah, since its an Email template the /apex/pagename notation wouldn't work.. Have you tried with the $Page notation? I think that might work
never used the $Page notation before could you give me some tips or an example in my template please!
Thank you!