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
satheesh psatheesh p 

[Unable to find 'findAll' on 'compound://my_namespace.AccountList'.

Hi All,
      
      I am trying to Build an Account Geolocation App.it show the follwing error.Unable to find 'findAll' on 'compound://my_namespace.AccountList
the bellow code is  i am using.

AccountCountroller.apxc
public with sharing class AccountController {
    @AuraEnabled
    public static List<Account> findall(){
        return [SELECT id,name,Location__Latitude__s,Location__Longitude__S FROM Account WHERE Location__Latitude__s != null AND 
                Location__Longitude__S != null Limit 50];
    }

}

AccounLocator.cmp
<aura:component implements="force:appHostable">
    <div>
        <div>AccountMap Goes Here</div>
        <div> <my_namespace:AccountList />  </div>
    </div>
</aura:component>

AccountLocatorApp.app
<aura:application >
    <ibrook_ibi:AccountLocator />
</aura:application>


AccountListItem.cmp
<aura:component >
    <aura:attribute name="account" type="Account"/>
    <li><a>{!v.account.Name}</a></li>
</aura:component>

AccountList.cmp
<aura:component controller="AccountController">

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

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

</aura:component>

AccountController.js
({
    doInit : function(component, event) {
        var action = component.get("c.findAll");
        action.setCallback(this, function(a) {
            component.set("v.accounts", a.getReturnValue());
        });
        $A.enqueueAction(action);
    }
})

waiting for your response.

  Thank you..
Best Answer chosen by satheesh p
sfdcMonkey.comsfdcMonkey.com
hi satheesh
javaScript is case-sensitive
in your class, method name is findall  but you use  findAll  so you got this error 
use
var action = component.get("c.findall");
in your  AccountController.js
I hope it helps you
Mark it best answer if it helps you
Thanks

All Answers

sfdcMonkey.comsfdcMonkey.com
hi satheesh
javaScript is case-sensitive
in your class, method name is findall  but you use  findAll  so you got this error 
use
var action = component.get("c.findall");
in your  AccountController.js
I hope it helps you
Mark it best answer if it helps you
Thanks
This was selected as the best answer
satheesh psatheesh p
Thanks piyush_soni