• Dinesh Lodhi
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hello Everyone,

I am new to SF Lightning, getting above issue while retrieving 10 accouts record on Lightning Builder App.

Kindly assist to resolve this issue.

----AccountPracticeLC.apxc---------------------

public class AccountPracticeLC {
 public static List<Account> ListAct;
 @AuraEnabled
 public static List<Account> FetchAccountRecord(){
     ListAct = [select Name, AccountNumber, Phone, Industry from Account Limit 10];
     return ListAct;      
    }
}

-------------AccountPracticeLC_Cmp.cmp-----------------

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" controller ="AccountPracticeLC" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
      <aura:attribute name="Accounts" type="Account[]"/>
    <section class="slds-card__body">
                   
          <div class="slds-tile slds-hint-parent">
              <p class="slds-tile__title slds-truncate">Name: 
                  <ui:outputText value="{!v.Accounts.Name}"/>
              </p>
        <p class="slds-truncate">Account Number: 
            <ui:outputText value="{!v.Accounts.AccountNumber}"/>
        </p>
        <p class="slds-truncate">Phone:
            <ui:outputNumber value="{!v.Accounts.Phone}" />
        </p>
                      <p class="slds-truncate">Industry:
            <ui:outputText value="{!v.Accounts.Industry}" />
        </p>

    </div>
        </section>  
    
  </aura:component>

--------------------------Controller---------------

({
    doInit : function(component, event, helper) {
       
       helper.FetchAccountRecord(component);
    },
})

-------------------------Helper--------------------

({
  FetchAccountRecord: function(component) {
        var action = component.get("c.FetchAccountRecord");
        action.setCallback(this, function(data) {
            var state = data.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.Accounts", data.getReturnValue());
                system.log(response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
        },    
})
Hello Everyone,

I am new to SF Lightning, getting above issue while retrieving 10 accouts record on Lightning Builder App.

Kindly assist to resolve this issue.

----AccountPracticeLC.apxc---------------------

public class AccountPracticeLC {
 public static List<Account> ListAct;
 @AuraEnabled
 public static List<Account> FetchAccountRecord(){
     ListAct = [select Name, AccountNumber, Phone, Industry from Account Limit 10];
     return ListAct;      
    }
}

-------------AccountPracticeLC_Cmp.cmp-----------------

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" controller ="AccountPracticeLC" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
      <aura:attribute name="Accounts" type="Account[]"/>
    <section class="slds-card__body">
                   
          <div class="slds-tile slds-hint-parent">
              <p class="slds-tile__title slds-truncate">Name: 
                  <ui:outputText value="{!v.Accounts.Name}"/>
              </p>
        <p class="slds-truncate">Account Number: 
            <ui:outputText value="{!v.Accounts.AccountNumber}"/>
        </p>
        <p class="slds-truncate">Phone:
            <ui:outputNumber value="{!v.Accounts.Phone}" />
        </p>
                      <p class="slds-truncate">Industry:
            <ui:outputText value="{!v.Accounts.Industry}" />
        </p>

    </div>
        </section>  
    
  </aura:component>

--------------------------Controller---------------

({
    doInit : function(component, event, helper) {
       
       helper.FetchAccountRecord(component);
    },
})

-------------------------Helper--------------------

({
  FetchAccountRecord: function(component) {
        var action = component.get("c.FetchAccountRecord");
        action.setCallback(this, function(data) {
            var state = data.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.Accounts", data.getReturnValue());
                system.log(response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
        },    
})