You need to sign in to do that
Don't have an account?
Priyesh Misquith 12
combining multiple map into one
<id,Sobject> map1 = <id, Sobject>();
<id,Sobject> map2 = <id, Sobject>();
if map1 and map2 contain same key with different values.
how to add map2 values to map1 without deleting map1 values.
<id,Sobject> map2 = <id, Sobject>();
if map1 and map2 contain same key with different values.
how to add map2 values to map1 without deleting map1 values.
For adding both map values , combining into single map
Finally you will get a joint map
All Answers
For adding both map values , combining into single map
Finally you will get a joint map
I am getting following error while trying your code
Method does not exist or incorrect signature: void put(String) from the type Map<Id,List<SObject>>
replace this line
mainMap.put(key)
to
mainMap.put(key , lstAccount);