I have a custom object called "Call_List__c" which has a field named "Call_List_Members__c". This field has a list of Contact Id's separated by commas.
In an apex class, I split the "Call_List_Members__c" field into a list and then I'm doing an SOQL query to pull the all of the contact records from the list.
Please see code below:
List<String> contactIds = new List<String>();
contactIds = callList[0].Call_List_Members__c.split(',');
List<Contact> callListMembers = [
SELECT Id, Name, Title, Department, Phone, Email
FROM Contact
WHERE Id IN :contactIds
];
return callListMembers;
The problem here is that when I return the callListMembers query, there is only one result. Is there something that I've overlooked here? I want to return all of the records based on the ID's in the Call List Members field.