function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nick HaleNick Hale 

making a list of contacts and Accounts problem

Ok so i am making a application that pulls up a list of Accounts and Contacts. the problem is that when i try to load the tab it goes  "We're still working on your requast.. please wait." its being doing that for 2 days now and i have gone through my components  and  there seems to be nothing  wrong in my code. does anyone have a idea why its doing that?
YogeshMoreYogeshMore
I will try to solve your problem, Could you share your code ?
Nick HaleNick Hale
public with sharing class listedController {

      
   @AuraEnabled public static List<Contact> findAllContacts() {
       return [SELECT Id, Name
       FROM Contact];
   }   
     @AuraEnabled public static List<Account> findAll() {
       return [SELECT Id, name
       FROM Account];
   }   
}
this is my apex class controller ^^
<aura:component implements="force:appHostable">

    <div>
       <div>
           <c:AccountList />
       </div>
       <div>
           <c:ListedList />       
       </div>
    </div>

</aura:component>
 
<aura:component >

    
    <aura:attribute name="contact" type="Contact"/>

    <li><a>{!v.Contact.Name}</a></li>

</aura:component>

<aura:component controller="listedController">

   <aura:attribute name="contacts" type="Contact[]"/>
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" />

   <ul>
       <aura:iteration items="{!v.contacts}" var="contact">
           <c:ListedItem contact="{!contact}"/>
       </aura:iteration>
   </ul>

</aura:component>
({
    doInit : function(component, event) {
        var action = component.get("c.findAllContacts");        
        action.setCallback(this, function(a) {
            component.set("v.Contacts", a.getReturnValue());
        });
        $A.enqueueAction(action);
    }
})

<aura:component controller="listedController">
    
   <aura:attribute name="accounts" type="Account[]"/>
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" />

  <ul>
       <aura:iteration items="{!v.accounts}" var="account">
           <c:Accountv2Item account="{!account}"/>
       </aura:iteration>
    </ul>

</aura:component>
({
    doInit : function(component, event) {
        var action = component.get("c.findAll");        
        action.setCallback(this, function(a) {
            component.set("v.Accounts", a.getReturnValue());
        });
        $A.enqueueAction(action);
    }
})

<aura:component >
	 <aura:attribute name="account" type="Account"/>

    <li><a>{!v.Account.Name}</a></li>
    
</aura:component>


 
Bhaswanthnaga vivek vutukuriBhaswanthnaga vivek vutukuri
keen to find the soultion after Raj solving this
Michał Zadrużyński 2Michał Zadrużyński 2
How many accounts and contacts do you have in system? Have you tried to put debug log in apex class to check if method is fired and what is returning to aura? Or console.log and view what is in dev console in webbrowser?
Paul Allsopp 3Paul Allsopp 3
Add a limit to your query (LIMIT 10) and see if that works. If it does then the system is simply being overloaded. However, retrieving a list of anything more than 100 ites is probably discouraged anyway, as you should be adding paging.