The aim of this code is to set a value for the booker__c field in Ticket__c object. I am getting an error of Initial term of field expression must be a concrete SObject: List. All the Names returned to the getContactBooker() funtion will put in the Booker__c fields in Ticket__c. For Example The getContactBooker() will returned a list values of{john,martin,hannah}, These values will be put into the Booker__c field in Ticket__c so that when i call the newTicketList() it will return the {john,martin,hannah} values when i want to access the Booker__c field.
HERE IS MY CODE. IS THIS THE RIGHT WAY OF PUTTING A NEW VALUES
@AuraEnabled
Public Static List<Ticket__c> newTicketList(String textsearch,String EventName,String FieldSearch){
List<Contact> j = getContactBooker(textsearch,EventName,FieldSearch);
List<String> newids = new List<String>();
for(integer i=0; i<j.size(); i++)
{
newids.add(j[i].Name);
}
List<Ticket__c> values = new List<Ticket__c>();
for(integer i = 0; i< newids.size(); i++){
values.Booker__c = newids[i];<--------ERROR POINTS HERE
}
return values;
}