Here's what I'm using as a custom button control in Salesforce that executes JavaScript.
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p7=GetURLHere&p2_lkid={!Case.ContactId}&template_id=00Xc0000000HrOk');
The GetURLHere
part is where I'd like to grab the current URL and place it on the next page.
This form works like Select Listview > Click Button > New page loads with the previous pages URL in the p7 field.
p7
represents a field I'd like to put it into upon page load.
The usual document.location.href
doesn't want to work in this control.
Any idea on how to do this in the Force environment?
Here's what I'm using as a custom button control in Salesforce that executes JavaScript.
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p7=GetURLHere&p2_lkid={!Case.ContactId}&template_id=00Xc0000000HrOk');
The GetURLHere
part is where I'd like to grab the current URL and place it on the next page.
This form works like Select Listview > Click Button > New page loads with the previous pages URL in the p7 field.
p7
represents a field I'd like to put it into upon page load.
The usual document.location.href
doesn't want to work in this control.
Any idea on how to do this in the Force. environment?
Share Improve this question edited May 14, 2012 at 19:17 Command-Z asked May 13, 2012 at 1:25 Command-ZCommand-Z 131 silver badge5 bronze badges1 Answer
Reset to default 4You should be able to use the $CurrentPage object to get the current pages url as a formula expression.
document.location.href = '{!$CurrentPage.URL}';