You need to sign in to do that
Don't have an account?
jasonkor
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.');}
}
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.');}
}
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