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
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