You need to sign in to do that
Don't have an account?

Looking for Function or Var that represents the Std Domain (eg "na2.salesforce.com")
Is there some function or global var that I can use to get from my VF page to a standard page? I want the standard email edit page for my email template.
In sandbox in my VF page I have a button that executes this javascript
location.replace("/email/author/emailauthor.jsp?retURL=/{!Onboarding_Request__c.Id}&p3_lkid={!Onboarding_Request__c.Id}&template_id=00X200000013Z9D&p26=0D220000000CaoV:abc@xyz.com:XYZ GLOBAL mailbox&p24=...etc.
but it takes me to https://c.cs2.visual.force.com/email/author/emailauthor.jsp....etc.
... whereas where I really want to go is to https://cs2.salesforce.com/email/author/emailauthor.jsp....etc. (the sandbox domain for my regular standard pages).
Now the emailauthor page from the visual.force.com domain does work however it is implemented slightly differently in htat the email preview is in a fixed size area with no scrollbars. From the standard domain it is much nicer in that the preview resizes to the email and it can all be seen.
So what I'd like to do is something like:
location.replace("{!$STDDOMAIN}/email/author/emailauthor.jsp?retURL=/{!Onboarding_Request__c.Id}&p3_lkid=...etc.
if such a function or variable should exist.
Is anyone aware of a way to do this?
TIA.
Can't you use Urlfor to generate the full URL for the action you want? Where did you get this url from? If it correspond to some standard action you should be able to url urlfor with that action name to ge what you want (and in a way that won't break if salesforce changes the url in future...)
All Answers
I think this should do the trick:
$Api
Sorry, what I'm after is a merge field that when used in a VF page (ie from a visual.force.com domain) will give me the regular salesforce.com domain name for my org e.g. "cs2.salesforce.com" .
I tried the above but it gave me https://c.cs2.visual.force.com/...etc. which is the VF domain.
Sorry which API method did you use (there's no code in your post)?
I've used: $Api.Partner_Server_URL_90
And I've gotten: https://cs2.salesforce.com/services/Soap/u/9.0/xxxxx0000zdh
Wes
Hi Wes,
I've just used {!$Api.Partner_Server_URL_90} in a VF page in my sandbox and it shows
https://c.cs2.visual.force.com/services/Soap/u/9.0/xxxxxx000008MXH
I'm not sure why we are seeing differrent results. I'm in a UE org if that makes a difference.
regards
Colin.
Can't you use Urlfor to generate the full URL for the action you want? Where did you get this url from? If it correspond to some standard action you should be able to url urlfor with that action name to ge what you want (and in a way that won't break if salesforce changes the url in future...)
High-five for UE.
I've no idea, we seem to be using it the same way. You've got premier support with UE, bump them for an answer? They're pretty good.
Wes
The following seems to return the part of the URL I was after (from a VF page in my sandbox, it should work when deployed too)
returns
https://cs2.salesforce.com
(and not https://c.cs2.visual.force.com as I was getting before).
If you tried your previous solution, it would work in both the environments. When you don't specify the host, Salesforce picks up the current host. So, no matter you are in sandbox or production environment.