Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How to open information about an account on click of an account through Lightning Component?

    Tagged: AuraEnabled, Client Side Controller, Salesforce Account, Salesforce Lightning Component, Salesforce Record, Server-Side Controller

    • Salesforce® Discussions

      How to open information about an account on click of an account through Lightning Component?

      Posted by Shubham on August 31, 2017 at 5:44 AM

      How to open information about an account on click of an account through Lightning Component?

      For e.g; I have a List of account with account Name i.e;

      Account1

      Account2

      Account3

      If I click on any account name then the name, Phone of that account must be opened in a popUp Modal.

      Aman replied 8 years, 6 months ago 2 Members · 1 Reply
      • AuraEnabled
      • Client Side Controller
      • Salesforce Account
      • Salesforce Lightning Component
      • Salesforce Record
      • Server-Side Controller
    • 1 Reply
    • Aman

      Member
      September 7, 2017 at 1:20 PM

      Hello Shubham ,

      you can try this :

      server-side Controller :

      public class SearchAcc {
      @AuraEnabled
      public static List<Account> getAccList(){
      List<Account> acct=[select name,AccountNumber,phone,Description from account Limit 100];
      return acct;
      }

      @AuraEnabled
      public static Account getAcc(String ID){
      return[select name,Phone,Description from account where id= :ID];
      }
      }

      Component :

      <aura:component controller="SearchAcc" >
      <aura:registerEvent name="AccEvent" type="c:AccountDetailsEvent"/>
      <aura:attribute name="Accounts" type="Account[]"/>
      <aura:handler name="init" value="{!this}" action="{!c.getList}"/>
      <aura:iteration items="{!v.Accounts}" var="acc">
      <h1><a id="{!acc.Id}" title="click me to do something" href="#" onclick="{!c.getID}" >
      {!acc.Name}</a>
      </h1>
      </aura:iteration>
      </aura:component>

      client-side controller :

      ({
      getList : function(component, event, helper) {
      var action = component.get("c.getAccList");
      action.setCallback(this,function(response){
      var state = response.getState();
      if(state == "SUCCESS"){
      alert('success')
      component.set("v.Accounts",response.getReturnValue());

      }
      });
      $A.enqueueAction(action);

      },
      getID: function(component, event, helper) {
      var Ide = event.srcElement.id;
      var action= component.get("c.getAcc");
      action.setParams({ ID :Ide });
      action.setCallback(this, function(response) {
      var state = response.getState();
      if (state === "SUCCESS") {
      // console.log(response.getReturnValue());
      }
      var Eve=component.getEvent("AccEvent");
      Eve.setParams({ "Reqdata" :response.getReturnValue()});
      console.log(Eve.getParam("Reqdata"))
      Eve.fire();
      });
      $A.enqueueAction(action);
      }
      })

       

      • This reply was modified 8 years, 6 months ago by  Aman.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Why Bulk Automation Matters in Growing Salesforce Orgs

    Blog in Salesforce Products

    Salesforce is designed to scale with business growth. But as orgs expand, so does the effort required to manage them. More users, more objects, more…

    Salesforce, Salesforce Admin, Salesforce Applications, salesforcedeveloper
    AYAN Jan 20, 2026
    769  Views

    Mortgage Innovation for Salesforce Financial Services Cloud

    Blog in Salesforce Cloud Platform

    Salesforce recently announced a new feature Called Mortgage Innovation for  Financial Services Cloud that is designed to streamline the mortgage application process. This new tool includes a guide…

    Business Process, CRM Platform, Financial Services Cloud, Mulesoft Api, Salesforce Consultants
    AwsQuality Nov 14, 2019
    4,583  Views

    Top 6 Ways To Improve Communication With Customers With CRM | Salesforce

    Blog in Salesforce

    Businesses around the world have faced a sudden jolt due to the outbreak of the pandemic. The economic activities got halted, and everything and every…

    Automate Databases, Automated Emails, Business Success, Businesses, Call Centers
    Fexle Services Jun 3, 2021
    3,398  Views

    Popular Salesforce Videos

    Salesforce Marketing Cloud Automation Studio

    Salesforce Marketing Cloud Automation Studio

    Video in Marketing, Salesforce Cloud Platform

    Automation Studio is a Marketing Cloud application used to execute multi-step marketing and data management activities on an immediate, triggered, or scheduled basis. Use Automation…

    Salesforce Training, Salesforce Marketing Cloud, Salesforce Video, Salesforce Learning, Marketing
    Neha Yadav Aug 7, 2020
    2,314  Views
    What is Salesforce CRM?

    What is Salesforce CRM?

    Video in Salesforce Stories

    What is Salesforce CRM? Join this useful group for Salesforce job & career info and learn all about Salesforce CRM.

    Salesforce Training, Salesforce Tutorial, salesforce, CRM, Salesforce CRM
    Intelogik Nov 9, 2022
    1,705  Views
    Dreamforce 2020: Dreamforce to You | Salesforce

    Dreamforce 2020: Dreamforce to You | Salesforce

    Video in Salesforce Stories, Events

    Caylin walks us through what's in store for Salesforce's Dreamforce 2020 - Dreamforce to You! It's a month (or two?) long DF this year, so…

    dreamforce, Salesforce Event, Marc Benioff, Dreamforce to You, DF2U
    Abhishek Dec 4, 2020
    1,975  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.