You need to sign in to do that
Don't have an account?
SalesForce Dummy
Pull data from a map
I've created a map but am having a hard time figuring out how to pull data from it. Here's the map: Map m = new Map([SELECT ID, (SELECT ID FROM Contacts) FROM Account LIMIT 5]); How do I get to the fields from the Contact table?
You reference Contacts as an array. Here's an example:
Of course, you can also do things like:
Note that this is a List<Sobject>, not Map<Id,Sobject>, so if you need that sort of mapping, you would have to do something like this: