Hi I have an object as Product and another object as Product Line items.
What I am trying to do is fetch data from my Apex Controller in the form of Map which has Product as key and List of Line Items as values .
Map<Product__c,List<Product_Line_Items__c>>
The problem is the way I am getting the map in Lightning component is (which I am seeing through console log )
The requirement is to iterate the map and get header object so that I can display the field values like below
So now in lightning component's controller this is the way I am fetching this map from apex controller
action.setCallback(this, function(response){
var state = response.getState();
console.log(state);
if (state === "SUCCESS") {
var result =response.getReturnValue().mapProductToSKU;
for(var key in result){
arrayMapP.push({key: key, value: result[key]});
}
component.set("v.ProducttoSKU",arrayMapP);
Now in component
<aura:attribute name="PNumbertoSKU" type="Map" />
<aura:iteration items="{!v.PNumbertoSKU}" var="PNumber1">
PNumber1.key.field name
Here I am seeing data in this way
[Product__c (Product....] I am not seeing that particular field value