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
Arthur Almeida 12Arthur Almeida 12 

how to assemble a map that has a list inside

I need to use this code:
List<Asset> assets = map.get(accountId);
For this, I created this map:
Map<Id, List<Asset>>
but I do not know how to assemble this map, I have a list of the Assets, and each Asset has a lookup of the Account

 
Best Answer chosen by Arthur Almeida 12
Arthur Almeida 12Arthur Almeida 12
this help me
https://trailhead.salesforce.com/pt-BR/trailblazer-community/feed/0D54S00000H2pdCSAR

https://salesforce.stackexchange.com/questions/376261/how-to-assemble-a-map-that-has-a-list-inside/376262#376262