+ Start a Discussion

Inserting the current listview ID or Current page URL into an email field through a custom button

My organization has a lot of instances where someone needs to communicate a listview to another individual. Unfortunately, Salesforce does not refresh the listview's ID (my.salesforce.com/[This is the ID]) when a listview is selected. 

To facilitate communications, I'd like to place a custom button that pre-populates an email form with this ID in the send field. Many of us have seen how to "hack" the URL applications in Salesforce, and I was wondering if I could get something like {!$Currentpage.URL} to work for that field.


Is there any way to capture the current listview and place it in an email field?


 I've got a button that executes javascript like this: 




p7 refers to the field in which I'd like to insert the previous page's URL into, or at least listview ID into.


Here's a selection of the source code for the listview selection, I'm wondering if I can capture the selected value from here at least.



<option value="00B40000005UwDR">*****- Manager Open Overdue</option>
<option value="00B40000005UwDZ">*****- Manager Open ReadyActive</option>
<option value="00B40000005UwDe">*****- Manager RecentlyModified</option>
<option value="00B40000006FG3G"> ***** - AssignedBy Open</option>
<option value="00B40000006F9Yb" selected="selected">*****- AssignedTo Open ReadyActive</option>
<option value="00B400000063dc9">*****- AssignedBy Open</option>
<option value="00B400000063dc4">*****- AssignedBy Open Single Tasks</option>
<option value="00B400000063dbz">*****- AssignedBy RecentlyModified</option>
<option value="00B400000063dbu">*****- AssignedTo Open</option>



Well if you are looking for URL the you can try:

Url.getsalesforcebaseurl().toExternalform()/your record id




Did you find any workaround on this, I too have a same requirement where i need the List view ID.