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

    Revolutionizing Healthcare CRM: How Salesforce Deployment is Driving Digital Transformation

    Blog in Salesforce

    Healthcare has significantly transformed over time due to regulatory changes and patient expectations. Today, value rather than delivery is the primary concern. Patients' needs are…

    Artificial Intelligence, Boost Customer Experience, ChatBot, Chatbot Automation, Consulting Service
    GetOnCRM Mar 9, 2023
    1,387  Views

    Salesforce Commerce Cloud: Maximizing Revenue

    Blog in Salesforce Cloud Platform

    In the ever-evolving world of e-commerce, staying ahead of the competition and delivering exceptional customer experiences is critical. With the advent of Salesforce Commerce Cloud,…

    Applications, Australia, Automate Marketing Campaigns, Benefits, Boost Conversion Rates
    Kizzy Consulting Aug 4, 2023
    1,325  Views
    How To Use Tokens in salesforce Lightning

    How To Use Tokens in Salesforce Lightning?

    Blog in Lightning, Salesforce customization, Salesforce Implementation

    This is one of the cool features of Salesforce lightning mainly used for styling in components.You need to define code, values only once and use…

    CSS Frameworks, Design Tokens, Implement Salesforce Lightning, Lightning, Salesforce Customization
    Ajay Prakash Jan 10, 2018
    15,924  Views

    Popular Salesforce Videos

    Approval Process In Salesforce | Salesforce Development Tutorial

    Approval Process In Salesforce | Salesforce Development Tutorial

    Video in Salesforce Training

    Approval process in Salesforce. This video will cover the following points - 1. Approval Process Learn how to create an approval process. 2. Manage Approval…

    Salesforce Training, Salesforce Tutorial, Salesforce Development Tutorial, Salesforce Video, Salesforce Learning
    Algoworks May 24, 2021
    1,854  Views
    Salesforce For Beginners | Introduction To Salesforce | Salesforce CRM Development Tutorials

    Salesforce For Beginners | Introduction To Salesforce | Salesforce CRM Development Tutorials

    Video in Salesforce Implementation, Salesforce Training

    In this video, BeginIT provides an introduction to Salesforce, including its difference from legacy CRM systems. And also, BeginIT explains the procedure to create an…

    Salesforce Training, salesforce, CRM, Salesforce CRM, Salesforce Tutorials
    Mayra Aug 23, 2022
    2,054  Views
    8 Steps to Launch Your App on Salesforce AppExchange

    8 Steps to Launch Your App on Salesforce AppExchange

    Video in AppExchange, Salesforce Apps

    AppExchange is the largest business app store in the world, with over 4,000 apps and millions of users. In this video, we will guide you…

    salesforce, Salesforce Apps, Salesforce App Development, Salesforce Video, Salesforce AppExchange
    ENWAY Nov 6, 2023
    4,062  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.