I need to add a button to a Case, its called EI_Case_View; this is the javascript that the button I need added to the Visualforce page:
var splitHost = location.host.split('.');
var baseURL;
if(splitHost[0] == 'c') {
baseURL = 'https://' + splitHost[1] + ".salesforce.com";
} else {
baseURL = 'https://' + splitHost[0] + ".salesforce.com"
}
location = baseURL + '/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&[email protected]:Virtual1%20Provisioning&p6=Case%20{!Case.CaseNumber}%20 / {!URLENCODE(Case.Access_ID__c)}%20 / {!URLENCODE(Case.End_Customer_Name__c)}%20 / {!URLENCODE(Case.Site_Name_B_End__c)}%20 / {!URLENCODE( Case.Partner_Internal_Ref__c )}&template_id=00X30000001Wctm&p5=';
EDIT:
So this is what I have so far:
visual force page code: <apex:commandButton value="Email Partner (From Prov)" onclick ="($Action.Case.Email_Partner_From_Prov)" />
I added the script on the page also, including in the script tags.
<script>
var splitHost = location.host.split('.');
var baseURL;
if(splitHost[0] == 'c') {
baseURL = 'https://' + splitHost[1] + ".salesforce.com";
} else {
baseURL = 'https://' + splitHost[0] + ".salesforce.com"
}
location = baseURL + '/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&[email protected]:Virtual1%20Provisioning&p6=Case%20{!Case.CaseNumber}%20 / {!URLENCODE(Case.Access_ID__c)}%20 / {!URLENCODE(Case.End_Customer_Name__c)}%20 / {!URLENCODE(Case.Site_Name_B_End__c)}%20 / {!URLENCODE( Case.Partner_Internal_Ref__c )}&template_id=00X30000001Wctm&p5=';
}
</script>