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, 4 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, 4 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

    Winning the Holiday Rush: Salesforce CRM's AI and Real-Time Data Strategies for eCommerce Companies

    Blog in Salesforce

    The holiday season is one of the most awaited and important times of the year for eCommerce companies. As online shopping demand soars, businesses must…

    Artificial Intelligence, Automation, CRM, CRM Integration, Customer Behavior
    Damco Oct 31, 2023
    1,370  Views

    Your Journey to Salesforce to Becoming a Salesforce Developer

    Blog in Salesforce

    As an informational guide for Salesforce beginners and anyone who would like to start a career in it, this article assembles the basic knowledge about…

    Business Processes, Cloud Computing Salesforce, CRM Skills, CRM Solutions, Custom Salesforce Solutions
    Sarfaraz Sep 9, 2024
    496  Views

    Salesforce CPQ – Top 9 Benefits – Prepare Accurate Quotes in Moments not Months!

    Blog in Salesforce Einstein, Salesforce Implementation

    Configure Price Quote (CPQ) is a salesforce cloud toolkit available in Salesforce that allows your business to provide your customer with accurate sales quotes and…

    Cloud Toolkit, Customer Experience, Salesforce Consulting, Salesforce CPQ, Salesforce Einstein AI
    DemandBlue Nov 20, 2018
    5,794  Views

    Popular Salesforce Videos

    What is Salesforce Permission Sets? Explain in Details

    What is Salesforce Permission Sets? Explain in Details

    Video in Salesforce Admin

    Permission Sets basically deals with improvising the additional permission from the existing profile. Watch this video to learn more about Salesforce Permission Sets. If you…

    Salesforce Training, Salesforce Administrator, Salesforce Profiles, Rules in Salesforce, Salesforce Permissions
    CRS Feb 25, 2022
    2,051  Views
    How to Setup Salesforce Customer Community?

    How to Setup Salesforce Customer Community?

    Video in Salesforce Communities

    Step by step Salesforce tutorial for quickly setting up a Customer Community with Customer Service (Napili) Template.

    Salesforce Tutorial, Salesforce Sales Cloud, Salesforce Administrator, Salesforce Customer Community, Salesforce Community
    Shivam Sisodia Jan 12, 2018
    2,602  Views
    Tour to the Dreamforce National Park!

    Tour to the Dreamforce National Park!

    Video in Others

    What happened at Dreamforce? #ArtificialIntelligence was a consistent theme, a lot more about Commerce, about Customer 360, etc Missed Dreamforce? Then, take a tour of…

    Dreamforce Event, Salesforce Events, Dreamforce 2019, DF 19, Customer 360
    Algoworks Nov 29, 2019
    1,817  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.