6

Salesforce Lightning Component

I am creating a salesforce lightning component to list the leads of the current logged in user.

I have managed to write the following code, but when i add the component to the page, and preview it, I dont see any leads.

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<div class="slds">

<table class="slds-table slds-table--bordered slds-table--striped">
<thead>
<tr>
<th scope="col"><span class="slds-truncate">Company</span></th>
<th scope="col"><span class="slds-truncate">Annual Revenue</span></th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.leads}" var="lead">
<tr>
<td>{!lead.Company}</td>
<td>{!lead.AnnualRevenue}</td>
</tr>
</aura:iteration>
</tbody>
</table>
</div>

It will be great, if someone could tell me what is that I am doing wrong. Visit here! https://goo.gl/7jNnWu

Thank you

Comments
  • 1
    How are you retrieving the leads? You don’t have a controller called and I don’t see a data loader.

    Also, welcome to devRant! I suspect a lot of SF based rants 😂

    In your <aura:component>

    Add Controller=“lead”
    It could be leads...

    Oh and the aura:attribute for leads aswell otherwise v.leads in your iterator doesn’t actually have anything to loop on.

    Check out https://trailhead.salesforce.com/en... if you haven’t already.
  • 1
    Wow, this looks like a screwed up variant of ASP.NET ,(sorry, not being helpful here, welcome to devRant btw).
  • 0
    @RememberMe it’s, actually no I don’t know what to compare it too.

    It’s like angular / react sort of with basically Java for server side, with its own way of doing things and interacting with the platform.
Add Comment