function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Waqar Hussain SFWaqar Hussain SF 

Error: Compile Error: Initial term of field expression must be a concrete SObject: MAP<Id,Account>

 how to get map record (Here Entity_Type__c)
 Map<Id, Account> accounts = new Map<Id, Account>( [Select Id, Name,Entity_Type__c From Account Where Id in : sponsorShipOppties.keyset() ] );
  for( Opportunity o : sponsorShipOppties.values() ) {
        sponsorListingRecords.add( new Sponsor_Listing__c( Sponsor_Account__c = o.AccountId, Total_Sponsored_Amount__c = o.Amount, Status__c = 'New', Locations__c = locations, Entity_Type__c = accounts.get(o.Entity_Type__c) ) );
    }
EnreecoEnreeco
Hi Waqar,
your code seem all ok.
Can it be a problem with the "sponsorShipOppties" map? Is it atually a ID/Opportunity map?

--
May the Force.com be with you!