I created an activity list button to select multiple records from a list view and process in a visualforce page/apex controller. I used GETRECORDIDS($ObjectType.Event)
to get Ids of selected Event records. BUT it returned ids of tasks too. Then I replaced $ObjectType.Event
by $ObjectType.Task
the returned result was same. I then replaced it by $ObjectType.Contact
still the returned result was same.
My question is if selected ids are returned irrespective of the $ObjectType.object
then why it is there?
Am i missing something?
Here is the code on the Button:
var ids = {!GETRECORDIDS($ObjectType.Event)};
if (ids.length) {
window.location = '/apex/mypage?ids=' + ids.join(',');
} else {
alert('Select one or more Records');
}