function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jasonkorjasonkor 

How can I add a custom list view onclick button to my Visualforce page

We have created a custom button that currently works on a case list view.  I have not been able to reference or add this button to my visualforce page.  Please help

Object Name Case
Name Assign_Next_Tier_1_Case   
Behavior Execute JavaScript Display Type List Button


{!REQUIRESCRIPT("/soap/ajax/18.0/connection.js")}

{!REQUIRESCRIPT("/soap/ajax/18.0/apex.js")}
var id = sforce.apex.execute("CaseAssignment_CS_Global","GetTier2NextCase",{userId:""});

var idtest = new String(id);

if (id!='' && idtest.length > 14) {


var querystringParams = "";
if (window.location.href.indexOf("isdtp=mn")!=-1) {
querystringParams = "?isdtp=mn";
} else if (window.location.href.indexOf("isdtp=vw")!=-1) {
querystringParams = "?isdtp=vw";
}


//We have successfully retrieved a case
navigateToUrl('/'+id + querystringParams);
} else {
if (id == '0000'){alert('No cases are available at this time.');}
else if (id == '0001'){alert('Error 1: Please contact the SF PM Team.');}
else {alert('Error 2: Please contact the SF PM Team.');}


}
VikashVikash (Salesforce Developers) 
Hi,

Plesae refer the link below
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_sosc_custom_button.htm

Hope this helps!!!

Thanks
Vikash_SFDC
jasonkorjasonkor
I'm sorry Vikash but I have read the document that you provided a link to and I fail to see how it relates to how I can add my custom button to my visualforce page.  Can you please clarify?