You need to sign in to do that
Don't have an account?
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) ) );
}
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) ) );
}
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!