0

I have a text field (Recruiters_working_on__c) on the object ts2__Job__c that contains the names of multiple users in String form. I want to return a list of Users if the Recruiters_working_on__c field contains the name of a User. This is what I have but it's returning no results -

public with sharing class getOpenRecuiters {
@AuraEnabled(cacheable=true)
public static List<User> getOpenRecuiters() {
   List<ts2__Job__c> reqs = new List<ts2__Job__c>();
   List<String> users = new List<String>();
   reqs = [SELECT Recrutiers_Working_On__c FROM ts2__Job__c WHERE Division__c = 'MS' AND ts2__Status__c = 'Open'];
   for (ts2__Job__c user : reqs) {
    users.add(string.valueOf(user));  
}
   return [SELECT Name FROM User WHERE Name IN :users];    
}

}

1 Answer 1

2

change users.add(string.valueOf(user)); to

users.add(user.Recrutiers_Working_On__c);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .