You need to sign in to do that
Don't have an account?
CloudHugger2
Weird behaviour - Maps
Hi All,
This one has me stumped - am concerned its one of those 'OMG - what was I thinking!' moments..
In my Apex, I retrieve a record stored in a map, however when I try to access the field values stored within it they are not accessible, despite being populated...
Position__c p1 = posMapByType.get(position); // I definitely get a value into P1. The Member field is populated per debug log: DEBUG|a->Position__c:{Member__c=a03N0000000xxxKIA2, etc... system.assert(p1.Member__c != null); // apparently not!!!
This has me completely flumixed (is that a word??) Any suggestions appreciated - spent far too much time on this!! :)
Hi,
Can you try below :-
Position__c p1 = posMapByType.get(position);
DEBUG|a->Position__c:{Member__c=a03N0000000xxxKIA2, etc...
System.assertNotEquals(p1.Member__c , null);
Thanks for suggestion.
No joy!
I changed the debugging
Position p1 = posMapByType.get(position);
system.debug('a->'+p1);
system.debug('b->'+p1.Member__c);
I get a result a->Position__c{Member__c = a03N000000xxx etc.
Then b->null
Bizarre!