+ Start a Discussion
NishhNishh 

How to get record Ids from listview selected records through custom button click

I have a custom button on list view where i want to select multiple records through checkbox and get their ids in apex class but there is no visualforce page. I have created a list button where i have used javascript to call that class. how to pass record ids to that class.

Please advise
Ramu_SFDCRamu_SFDC
Hi,

The best way to accomplish your requirement of showing checkboxes and selecting would be with the use of Wrapper class. Please review more information on wrapper class at the link http://wiki.developerforce.com/page/Wrapper_Class .

To run the apex on button click you need to use controllers as explained in the link below http://andyinthecloud.com/2013/07/16/how-to-call-apex-code-from-a-custom-button/
khillan bhardwajkhillan bhardwaj
Hi,
you can get it by using following method :

var salesinvids = {!GETRECORDIDS($ObjectType.ObjectApi_name)};

here you get comma seperated id of selected records.

Thanks,
Khillan Singh