Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class VE_AutoLeadController {
public List<String> leadIdsSet { get; set; }
public List<Lead> selectedLeadRecords { get; set; }
public VE_AutoLeadController(ApexPages.StandardSetController setController) {
selectedLeadRecords = (Lead[])setController.getSelected();
leadIdsSet = new List<String>();
for(sObject sobj : setController.getSelected()){
leadIdsSet.add( (String)sObj.get('Id') );
}
// SOQL on Lead Object if you need more Fields
selectedLeadRecords = [SELECT Id, Name, Company, Phone, Email, Rating FROM Lead WHERE Id IN: leadIdsSet];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment