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

    No Code Salesforce and Typeform Integration

    Blog in Salesforce integration

    Information gathering and sharing are made easy and interactive with Typeform. It is a web-based platform that enables you to build anything from apps to…

    API, App Launcher Icon, Apps to Surveys, Business Decisions, Collect Data
    Apphienz Sep 26, 2022
    1,956  Views

    5 Reasons to Embrace Salesforce Managed Service

    Blog in Salesforce

    The managed service model has proven to be highly effective for businesses over the years. With no necessity to set up office infrastructure or hire…

    Bug Fixing, Business Functioning, Business Processes, Business Setup, Businesses
    Carol Oct 6, 2020
    3,562  Views
    ServiceNow Integration

    How to Set up a Salesforce ServiceNow Integration [Step-by-Step Guide]

    Blog in Salesforce integration

    How to Set up a Salesforce ServiceNow Integration [Step-by-Step Guide] Salesforce ServiceNow integration can assist your teams in better acquiring and aggregating their already increasing…

    AppExchange, AppExchange Dashboard, Applications, Apps, Automation Application
    jameel Feb 2, 2022
    4,972  Views

    Popular Salesforce Videos

    How To Set Up A Site On Salesforce | Salesforce Development Tutorial

    How To Set Up A Site On Salesforce | Salesforce Development Tutorial

    Video in Salesforce Development

    Learn how to set up a site on Salesforce. This tutorial will cover the following points - 1. Create Public Websites Choose a branded URL…

    Salesforce Training, Salesforce Development, salesforce, Salesforce Development Tutorial, Salesforce Video
    Algoworks Dec 28, 2020
    1,884  Views
    Drive Adoption with In-App Guidance and our Prebuilt Salesforce Package!

    Drive Adoption with In-App Guidance and our Prebuilt Salesforce Package!

    Video in Salesforce Admin

    With In-App Guidance generally available in the Winter ‘20 release, there’s no better time to start taking advantage of the easiest way to add informative…

    salesforce, Salesforce Admin, Salesforce Video, Salesforce Features, In App Guidance
    Manpreet Apr 14, 2020
    2,907  Views
    What are Collections in Apex? | Salesforce Development Course

    What are Collections in Apex? | Salesforce Development Course

    Video in Salesforce Apex, Salesforce Training

    Shrey explained different types of Collections in Apex in this video. Watch the video now and learn, let us know in the comments if you…

    Salesforce Training, Salesforce Tutorial, Salesforce Development, Salesforce Apex, Salesforce Video
    Jogender Jul 22, 2021
    4,963  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.