You need to sign in to do that
Don't have an account?
KevinRussell
Initial term of field expression must be a concrete SObject
I'm trying to populate a local map. I'm getting the error:
Compile Error: Initial term of field expression must be a concrete SObject: MAP<Id,npe5__Affiliation__c> at line 33 column 13
What am I doing incorrectly?
Thanks,
Kevin
// Store temporary Affiliation records map< id, npe5__Affiliation__c > Affiliations = new map< id, npe5__Affiliation__c >(); // Building local list for (npe5__Affiliation__c afl : [Select npe5__Contact__c, npe5__Organization__c, Type__c, npe5__Status__c, npe5__Role__c from npe5__Affiliation__c WHERE npe5__Contact__c = :record.npe5__Contact__c AND npe5__Organization__c = :record.npe5__Organization__c ] ){ Affiliations.npe5__Contact__c = afl.npe5__Contact__c; Affiliations.npe5__Organization__c = afl.npe5__Organization__c; Affiliations.Type__c = afl.Type__c; Affiliations.npe5__Status__c = afl.npe5__Status__c; Affiliations.npe5__Role__c = afl.npe5__Role__c; // Add Affiliation records Affiliations.add(Affiliations); }
Affiliations.put(afl.id, afl);
All Answers
Hi Kevin,
There is no method .add in Map
you have to use Map.Put method.
see below link for reference:
Map Methods in Salesforce
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
Thanks hitesh90,
I changed the code and I'm getting this error:
Invalid foreign key relationship: npe5__Affiliation__c.id at line 33 column 30
Thanks for helping
Affiliations.put(afl.id, afl);
Hi Kevin,
Replace this line with real code..
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator