Find your content:

Search form

You are here

Initial term of field expression must be a concrete SObject:

 
Share
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


Attribution to: Eagerin Sf

Possible Suggestion/Solution #1

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]


Attribution to: eyescream

Possible Suggestion/Solution #2

tempInvoice is a list<Temp_Invoice__c>, so if you need information from a specific member of that list, you need to identify which member you want, possibly through square brackets. This is true even if you happen to know that there is only one member in the list. For example:

tempInvoice[0].First_Name__c = billing.billingfirstname;

Attribution to: Jeremy Nottingham
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4439

My Block Status

My Block Content