I'm new to programming so I apologize if I a missing a the concept here. I'm trying to respect bulkification when writing this class and was curious how you can do so given this scenario.
What I am going to do is feed a list of leadIds into the method and I want to do create a record if no record was found and use an existing an record if one was found. I know I need to query the existing record, but how do I go about adding those leads who did not have an existing record while still respecting bulk?
I understand that what I have below is not allowed but this is where my head went...
public class createLNBRecords {
private List<Lead_Not_Booked_Summary__c> createSummaryRecord(List<Lead> leadIds){
List<Lead_Not_Booked_Summary__c> foundSummaries = [SELECT Id
FROM Lead_Not_Booked_Summary__c
Where Lead__c IN :leadIds];
List<Lead> noSummary = [SELECT Id
FROM leadIds
Where NOT IN :foundSummaries];
}
}