You need to sign in to do that
Don't have an account?
ANAMIKA MONDAL 8
please help getting the list
I've written below snippet.. but getting error as 'Method does not exist or incorrect signature: void get(Id) from the type List<Line_Item__c>'
List<Line_Item__c> liness = [Select Id,Order_c,status__c from Line_Item__c where Order_c in :orderss];
Map<ID, List<Line_Item__c>> connection = new Map<ID, List<Line_Item__c>>();
for (Line_Item__c lii : liness)
{
connection.put(lii.Order_c, liness.get(lii.id));
}
Need to get a list<Line_Item__c> from liness while putting the value into map.
List<Line_Item__c> liness = [Select Id,Order_c,status__c from Line_Item__c where Order_c in :orderss];
Map<ID, List<Line_Item__c>> connection = new Map<ID, List<Line_Item__c>>();
for (Line_Item__c lii : liness)
{
connection.put(lii.Order_c, liness.get(lii.id));
}
Need to get a list<Line_Item__c> from liness while putting the value into map.
Aparently the get method takes only the integer value .
Regards,
Srikanth U.
You can do it like this
for(Line_Item__c lil : [select Id,Order_c,status__c from Line_Item__c where Order_c in :orderss]) {
if(connection.isEmpty()){
connection.put(lil.Order__c, new List <Line_Item__c> {lil});
}
}
Let us know if this will help you