• Nida Shaikh 17
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
I'm working a lightning component, which has a requirement of displaying a dynamic table.

For that, I need to iterate over a map (Map>) and display the values.

So, How can I retrieve map from apex controller and display values/key on the component ?

Apex Controller method signature –
public static Map<Id, Map<String, String>> getDataCollectionTableValues(Id dataCollectionId){
Apex method return value –
{  
   a0E0k000003aEKUEA2=   {  
      Field_10__c=test1,
      Field_1__c=test2,
      Field_2__c=test3,
      Field_3__c=test6,
      Field_4__c=null,
      Field_5__c=null,
      Field_6__c=test7,
      Field_7__c=null,
      Field_8__c=null,
      Field_9__c=test,
      ...
   }
}
Lightning helper – I’ve passed id parameter to controller method and set response to the map attribute.
 
({
    loadDataCollection: function(component) {

        var action = component.get("c.getDataCollectionTableValues");
        action.setParams({
            dataCollectionId : component.get("v.recordId")
        });

        action.setCallback(this, function(response)
        {
            var state = response.getState();
            if (state === "SUCCESS")
            {
                component.set("v.dataCollectionRecords", response.getReturnValue());
                 console.debug(response.getReturnValue());
            }else
            {
                console.debug(response.error[0].message);
            }
        });
        $A.enqueueAction(action);
    }
})

Component –
<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId" access="global" controller="DataCollectionTableController">
    <aura:attribute name="recordId" type="Id"/>
    <aura:attribute name="dataCollection" type="Data_Collection__c" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <aura:attribute name="dataCollectionRecords" type="Map"/>
    <aura:iteration items="{!v.dataCollectionRecords}" var="dcrRecord" indexVar="key">
        {!key}
        {!dcrRecord.key}
    </aura:iteration>

</aura:component>



 
Hello,

I'm working through the Admin Beginner Module in Trailhead, and have come across an issue where I cannot view the Hover menu icon. However, I've already gone to the Reports and Dashboard seetings and checked "Enable Dashboard Component Snapshots", as well as going to Chatter/Feed Tracking and checked "Enable Feed Tracking" and all components for both Reports and Dashboards, but still don't have the Hover menu icon to be able to Follow or post a snapshot of by Dashboard component. Any thoughts?

User-added image

Thanks,

Jessie
I am trying to finish the challenge in first chapter of formulas and validation in beginner trail(developer) to calculate the number of days between today and last activity date on a custom object.when I click on check challenge! I always get error message saying formula is incorrect.

here is the formula I did. TODAY()- LastActivityDate.
can anyone help?
Hi I have configured Live Agent but it is not showing in Console App. I have made all settings correctly.

My console app
User-added image