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
FilikinFilikin 

Get ID of Mass Email list view

Hi,
I am using this code to get the id of the list views on contacts:

Database.QueryLocator ql = Database.getQueryLocator('select id from Contact');
ApexPages.StandardSetController setController = new ApexPages.StandardSetController(ql);
System.SelectOption[] listViews = setController.getListViewOptions();
for(System.SelectOption listView : listViews)
{
    system.debug ('List view details: ' + listView);
}

but it doesn't give me the list views that appear when I go to the mass email contacts wizard - does anyone know how to get these?

My objective is to add a button to the campaign which will launch the wizard with the list view selected that matches the name of the campaign, just to cut a step out of the process.
thanks
FilikinFilikin
I have gotten a bit further with this, the mass email list views don't have an sObjectType associated with them, so I can get the ID of a individual list view with "Select ID from ListView where Name='Mass email list view name'"
But there are other list views that don't have an sObjectType and so I can't figure out how to filter out just the mass email list views.
Anyone know how?