I added a custom account list button via SalesForce setup.
So, when I click on Accounts
tab, then on All accounts
on selectList, I have all my accounts and on the top my custom button.
I want to know if there is a way to disable this button until at least one account is checked and enable it when user check one or many accounts ?
EDIT : It seems to be impossible to do.
So I did a validation like this : display an alert if no object is selected and redirect to a custom page if at least one object is selected :
var ids = {!GETRECORDIDS($ObjectType.Account)};
if(ids.length > 0) {
window.location='../apex/MyCustomPage?ids='+ids;
} else {
alert("No selection !");
}
But the problem encountered is if I have more than one ID, I have an error message saying me than an ID is composed by 15 characters only.
So how can I pass my ID (one or more) to my visualForce page to get them in my controller ?