kwood-pluscon
6/6/2019 - 5:19 PM

Query List of IDs

A single line solution to run a query and return a list of IDs

List<Id> idList = new List<Id>(new Map<Id, SObject>([SELECT Id FROM SObject WHERE Id IN :example]).keySet();