Is exist any function which can get id's all checked items in ERPNext?

I created “Test Button” in Menu. Can i print Id’s all selected Items(with enabled checkboxes)? Is exists any function in Erpnext which can do it?