You need to sign in to do that
Don't have an account?
Priyesh Misquith 12
Querying over map
Hi,
I have a following map
map<String , Fruits__c> mapFruits = new map<String , Fruits__c>();
where Key is name of the fruit and value is detail regarding fruit like color , taste etc.
Now i want to query on a different object called Tree__c based on key and values of this map mapFruits
List <tree__c> trees = [select region, name of the trees where fruitName = Should be the Key of the map and fruitTaste = field taste from the values of map and fruitColour ='field color from the values of map']
I am trying to avoid query inside the for loop.
I have a following map
map<String , Fruits__c> mapFruits = new map<String , Fruits__c>();
where Key is name of the fruit and value is detail regarding fruit like color , taste etc.
Now i want to query on a different object called Tree__c based on key and values of this map mapFruits
List <tree__c> trees = [select region, name of the trees where fruitName = Should be the Key of the map and fruitTaste = field taste from the values of map and fruitColour ='field color from the values of map']
I am trying to avoid query inside the for loop.
You can use the below code snippet:
Please take care of the syntax errors and api name of the fields.
Thanks,
Abhishek Bansal.