+ Start a Discussion
Vishnu7700Vishnu7700 

Initial term of field expression must be a concrete SObject: LIST<Account> at line 9 column 32

Hi,

Can any help to resolve the error.

Trigger is to convert to account,contact and opportunity once lead is created or updated

Code:

       trigger leadtoaccnconandopp on Lead (after Insert, after Update) {
        List<Lead> leadlist = new List<Lead>(); 
        List<Account> acclist = new List<Account>();
        List<Opportunity> opplist = new List<Opportunity>();
            if(Trigger.isInsert && Trigger.isUpdate){ 
                   for(Lead le:Trigger.new){     
                        if(le.IsConverted){
                               acclist.name = leadlist.name;
                               opplist.name = acclist.name;
                               opplist.CloseDate = Date.Today();             
                        }     
                        update opplist;       
                        update acclist;      
                    }    
                }  
            }

prakash_sfdcprakash_sfdc
Hi,

You can't use list directly, it should have a index.

Try
acclist[0].name = leadlist[0].name;
opplist[0].name = acclist[0].name;

You can use any dynamic index also.

Please give kudos if it helps.

Cheers!