+ Start a Discussion

List view Custom Buttons

Hi all,


Does anyone know of a way I can use a list view custom button to iterate through all the records that have been selected (via the checkbox) in the list? If this is not possible, is there anyway I can achieve the same functionality through a VisualForce page (again using checkboxes to select the records required)?





Best Answer chosen by Admin (Salesforce Developers) 

Right, given the fact that I posted this message twice and have still not gotten a reply! I have found out how to do this, you simply use the:


var ids = {!GETRECORDIDS($ObjectType.Contact)}


As part of the execute javascript within the button, you can then pass this in the URL by using:


 window.open("/apex/myPage?ids=" + ids.join(','));


The problem with this is you are limited to 255 characters in the URL. Alternatively, you can use javascript to invoke an apex method my using:







I hope this helps anyone who also needs to do this.