You need to sign in to do that
Don't have an account?
ExploreForce
Create a Map of related lists
Hi,
I have Parent obj:Products__c and child obj:Imagaes__c.
Map<Id,list<Imagaes__c>> mapofImagaes=new Map<Id,list<Imagaes__c>>();
/* list<Imagaes__c> lstImages = new list<Imagaes__c>();
for(Products__c xPrd:listRauPrds1)
{
// lstImages.clear();
for(Imagaes__c rImg:xPrd.Images__r)
{
//create a map
lstImages.add(rImg);
mapofImagaes.put(xPrd.id, lstImages);
}
}*/
In the above code, I m trying to create a map which holds first three images of Product1..so on.
Basically,I have to display three images of Product in my email template.
Pls can anyone suggest, how to create MAP ?So, that I can fetch map and display Images.
I have Parent obj:Products__c and child obj:Imagaes__c.
Map<Id,list<Imagaes__c>> mapofImagaes=new Map<Id,list<Imagaes__c>>();
/* list<Imagaes__c> lstImages = new list<Imagaes__c>();
for(Products__c xPrd:listRauPrds1)
{
// lstImages.clear();
for(Imagaes__c rImg:xPrd.Images__r)
{
//create a map
lstImages.add(rImg);
mapofImagaes.put(xPrd.id, lstImages);
}
}*/
In the above code, I m trying to create a map which holds first three images of Product1..so on.
Basically,I have to display three images of Product in my email template.
Pls can anyone suggest, how to create MAP ?So, that I can fetch map and display Images.
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Since you have implemented parent child relationsip,i think that you can construct your map like this,
thanks