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 add link on the Account Name for below given Scenario ?

    Tagged: Account, Contact Record, Custom Link, Help & Training, Hyperlink, Salesforce Customization, URL Field

    • Salesforce® Discussions

      How To add link on the Account Name for below given Scenario ?

      Posted by Aman on July 18, 2017 at 2:20 PM

      when we click on the link we get the description field and contact Associated with that account

      shariq replied 9 years, 3 months ago 2 Members · 1 Reply
      • Account
      • Contact Record
      • Custom Link
      • Help & Training
      • Hyperlink
      • Salesforce Customization
      • URL Field
    • 1 Reply
    • shariq

      Member
      August 14, 2017 at 1:55 PM

      Hi Aman,

      You can try this:-

      Apex Controller

      public class AccountLink
      {
      public String linkId {get;set;}
      public List<Contact> con{get;set;}
      public String searchString{get;set;}
      public List<Account> acct{get;set;}

      public void search1()
      {

      acct= Database.query('Select Name, description From Account WHERE Name LIKE \'%'+searchString+'%\' Limit 100');
      con = new List<contact>();
      }

      public void link()
      {

      con = [SELECT Id, Description, AccountId FROM Contact WHERE AccountId =:linkId LIMIT 100];

      }
      }

       

      Apex Page

      <apex:page controller="AccountLink" sidebar="false" id="page">

      <apex:form >
      <apex:actionFunction action="{!search1}" name="callingApex" reRender="idBlock1"/>
      <apex:pageBlock Id="idBlock">
      <apex:inputText value="{!searchString}" onkeyup="callApex()" />
      <apex:pageBlockButtons >
      <apex:commandButton value="search" action="{!search1}" rerender="idBlock1"/>
      </apex:pageBlockButtons>

      <apex:pageBlockTable value="{!acct}" var="account" id="idBlock1">
      <apex:column headerValue="Account Name" >
      <apex:commandLink value="{!account.name}" action="{!Link}" reRender="idPage">
      <apex:param value="{!account.Id}" name="ContactsShow" assignTo="{!linkId}" />
      </apex:commandLink>
      </apex:column>
      <apex:column >

      <apex:pageBlockTable value="{!con}" var="contact" id="idPage">
      <apex:column value="{!contact.Description}"/>
      <apex:column value="{!contact.Id}"/>
      </apex:pageBlockTable>

      </apex:column>
      </apex:pageBlockTable>
      </apex:pageBlock>
      </apex:form>
      <script>
      function callApex()
      {
      callingApex();
      }
      </script>
      </apex:page>

       

      Hope this helps.

    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

    Objects and Fields in Salesforce

    Learn All About Objects and Fields in Salesforce | Salesforce Developer Guide

    Blog in Salesforce Admin

    Objects  Objects are database tables that allow us to store data and information specific to the organization in Salesforce.  We can store data and information…

    Auto Number, Custom Fields, Custom Objects, Data Type, Data Values
    Sejal Agrawal Sep 6, 2022
    3,725  Views

    Overcome CRM Challenges With the Help of a Salesforce Consultant

    Blog in Salesforce

    Salesforce possesses powerful features and capabilities becoming the world’s leading CRM platform. It provides various companies an edge to move far beyond their customer’s expectations…

    Appexchange App Development, Building Relationships, Business Needs, Business Operations, Cloud CRM Solution
    Carol Jan 24, 2023
    2,187  Views

    Salesforce & SharePoint Integration – A Combination To Enhance Business Processes

    Blog in Salesforce integration

    Salesforce SharePoint Integration – Salesforce is the world’s #1 cloud-based CRM giant offering comprehensive CRM solutions to millions of leading brands across the globe. However,…

    Chatter, CRM Solutions, Salesforce Chatter, Salesforce Integration, Salesforce Sharepoint integration
    LevelShift (formerly DemandBlue) Aug 22, 2019
    4,227  Views

    Popular Salesforce Videos

    How to Get a Mentor? | Salesforce Learning | The Shrey Sharma Show

    How to Get a Mentor? | Salesforce Learning | The Shrey Sharma Show

    Video in Salesforce Training

    Looking for a mentor for Salesforce Learning? Watch this video to learn how to find one. Watch the full Video: https://youtu.be/6oi2zdJCFhs Check out the book:…

    Salesforce Training, Salesforce Jobs, salesforce, Salesforce Video, Salesforce Learning
    S2 May 12, 2022
    1,708  Views
    Heroku | Salesforce Development Course

    Heroku | Salesforce Development Course

    Video in Salesforce Certifications, Salesforce Training

    Knowledge of Heroku is also required to crack the Salesforce PD 1 Certification Examination. Let’s understand what Heroku is and what are its uses, in…

    Salesforce Training, Salesforce Certification, Salesforce Video, Salesforce Learning, Heroku
    S2 Apr 8, 2022
    1,897  Views
    Top 5 Marketing Tips to Reach Millennials | Salesforce Guide

    Top 5 Marketing Tips to Reach Millennials | Salesforce Guide

    Video in Salesforce Products, Marketing

    The word “millennials” has become a buzzword in recent years Millennials or members of Generation Y (also known as Gen Y) were born between 1982…

    salesforce, CRM, Salesforce Video, Salesforce Customer 360, Salesforce Marketing
    Kcloud Feb 19, 2021
    2,355  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.