[SalesForce] Initial term of field expression must be a concrete SObject:

list<Temp_Invoice__c>  tempInvoice = [select id,First_Name__c,Last_Name__c,Email__c from Temp_Invoice__c limit 1];
 tempInvoice.First_Name__c = billing.billingfirstname;

getting error as Initial term of field expression must be a concrete SObject:List

Best Answer

if you're assigning to a list of invoices, you should be consistent ;)

list<Temp_Invoice__c>  tempInvoice = [select id,First_Name__c,Last_Name__c,Email__c from Temp_Invoice__c limit 1];
if(!tempInvoice.isEmpty()){
    tempInvoice[0].First_Name__c = billing.billingfirstname;
}

Note the [0]

Related Topic