Issue
How can I redirect a user to a custom list view button with a specific set of records? Was hoping for something like this
{!URLFOR($Action.Account.List_View_Button, accountIds)}
Background
We're adding some usage tracking to some custom buttons in the org that create some conga documents. Our approach has been to create a second button that sends the user to a visualforce page and then redirects the user to the original button. The advantage of this is the tracked button can be modified or changed without messing with the usage tracking.
<apex:page standardController="Account" extensions="AB_LogACallJump" action="{!logUsage}">
<apex:outputPanel rendered="{!usageLogged}">
<script>
window.top.location.href = '{!URLFOR($Action.Account.Log_A_Call, account.id)}';
</script>
</apex:outputPanel>
</apex:page>
The button above can be launched from the detail page of an account, or from an account list view with multiple selections. We're trying to add tracking for the list view button, but have gotten stuck due to the inability (or ignorance of how) to use URLFOR with list view buttons.
List View Button
// STEP 1: CHANGE THE NEXT LINE TO THE TYPE OF RECORDS YOU'RE ACCESSING ON THE VIEW
var idArray = {!GETRECORDIDS( $ObjectType.Account )};
// STEP 2: CHANGE THE NEXT LINE TO THE API NAME OF THE FIELD THAT CONTAINS THE POINTMERGE URL
var urlFieldName="Log_A_Call_Pointmerge_Url__c";
// DO NOT MODIFY ANYTHING BELOW THIS POINT ********************
// YOU MAY PASS UP TO 50 IDS
var CongaURL = "https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx" +
"?MOID=" + idArray +
"&SessionId={!$Api.Session_ID}" +
"&ServerUrl={!$Api.Partner_Server_URL_160}"+
"&UrlFieldName="+urlFieldName;
window.open( CongaURL, "Conga", "width=700,height=450,menubar=0" );