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

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

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 .

To run the apex on button click you need to use controllers as explained in the link below
khillan bhardwajkhillan bhardwaj
you can get it by using following method :

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

here you get comma seperated id of selected records.

Khillan Singh