I want to display a relation Account>property__c>Booking__c>Order>OrderItem in a visualforce page. I want to nest the objects to represent these as parent>grandchildren> grand grandchildren>etc. I am trying to nest the order in a map but get the error:
Method does not exist or incorrect signature: void put(Id, Order) from the type Map>
I have the following:
//Property__c id, Booking__c
Map<Id, Booking__c> bookMap = new Map<Id, Booking__c>([
SELECT id, name, uidproperty__c
FROM Booking__c
WHERE uidproperty__c IN :propList
]);
system.debug('bookMap: '+bookMap);
//Booking id, Order
Map<Id, Order> ordMap = new Map<Id, Order>([
SELECT id, Name, booking__c,
(SELECT id, PricebookEntry.ProductCode from OrderItems )
FROM Order
WHERE booking__c IN :bookingList
]);
system.debug('ordMap: '+ordMap);
I tried the following:
Map<id,map<id,order>> nestMap = new Map<id,map<id,order>>();
for(id bkId :bookMap.keySet()) {
for(Order ol :ordMap.values())
{
system.debug('ol'+ol);
if(ordMap.values().booking__c== bkId){
nestMap.put(bkId,ol);
}
}
}