Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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, 11 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, 11 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

    Popular Salesforce Blogs

    Salesforce Consulting Services

    5 Exclusive Reason of Hiring Salesforce Consulting Services to Get Instant Popularity Among Enterprises

    Blog in Others

    Cloud computing systems that have a major influence on the field of online business have dominated the recent period. And Salesforce makes good use of…

    AppExchange Application Marketplace, Application, Artificial Intelligence, Automated Workflows, Business Model
    Emorphis Sep 29, 2020
    3,515  Views

    How to Hire a Salesforce Consulting Partner in India?

    Blog in Salesforce Consultant

    Hey there! When you are reading this, you must have come to realize that Salesforce is a business growth game changer. But to be truthful,…

    Salesforce, Salesforce Consultant, Salesforce Consulting
    Anjali Apr 13, 2026
    589  Views

    Introducing ForceGPT: Bringing Conversational AI Into Your Salesforce Experience

    Blog in Salesforce

    In today’s fast-paced business environment, success is no longer just about data and dashboards — it’s about how intuitively users can tap into that data…

    ChatGPT integration with Salesforce, ForceGPT, Salesforce AI Assistant, Salesforce conversational AI, Salesforce implementation support
    Dean Sep 29, 2025
    727  Views

    Popular Salesforce Videos

    What Is The Approximate Salary A Fresher Can Expect In The Indian Market Of Salesforce?

    What Is The Approximate Salary A Fresher Can Expect In The Indian Market Of Salesforce?

    Video in Salesforce Training

    Wondering what is the approximate salary a fresher can expect in the Indian market of Salesforce? Join this useful group for Salesforce job & career…

    Salesforce Training, Salesforce Tutorial, Salesforce Jobs, salesforce, Salesforce Video
    Intelogik Nov 21, 2022
    1,501  Views
    Develop a Basic Slack App For Salesforce

    Develop a Basic Slack App For Salesforce

    Video in Salesforce Stories

    Build Slack Apps integrated with Salesforce. Use Heroku to host Slack apps built using Slack Bolt Framework and get connected to Salesforce using Node.js library…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Nauman Dec 7, 2021
    2,925  Views
    Trailblazer Moment - Investing in Canada's Future

    Trailblazer Moment - Investing in Canada's Future

    Video in Trailhead

    Salesforce Ventures is excited to announce our Canada Trailblazer Fund, a $100 million fund to invest in Canadian startups and fuel cloud innovation and customer…

    Salesforce Event, Salesforce Trailhead, Customer Success, AI In Salesforce, Trailhead Module
    Hazel May 5, 2018
    1,824  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.