Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:07:07+00:00 2026-06-18T05:07:07+00:00

Sounds easy enough, but I’m taking the values output in my table from a

  • 0

Sounds easy enough, but I’m taking the values output in my table from a number of field sets, so admin users can customise the columns that appear in the table.

Here’s my functioning page block…

        <apex:pageBlock title="{!$Label.Search_Results}">
        <apex:pageBlockTable value="{!SearchResults}" var="pictureGallerySearchResult" title="SearchResults">
            <apex:column headerValue="Image" styleClass="imageDataCell">
                <a target="_blank" href="/servlet/servlet.FileDownload?file={!pictureGallerySearchResult.ActualAttachment.Id}" >
                    <img class="searchResultImage" style="{!SearchResultsImageStyle}" src="/servlet/servlet.FileDownload?file={!pictureGallerySearchResult.ActualAttachment.Id}" alt="{!pictureGallerySearchResult.ActualAttachment.Name}"/>
                </a>
            </apex:column>
            <apex:column headerValue="Test" value="{!pictureGallerySearchResult.Project[pictureGallerySearchResultField]}"/>
            <apex:repeat value="{!$ObjectType.Project__c.FieldSets.Picture_Gallery_Search_Results}" var="pictureGallerySearchResultField">
                <apex:column headerValue="{!$ObjectType.Project__c.Fields[pictureGallerySearchResultField].label}" value="{!pictureGallerySearchResult.Project[pictureGallerySearchResultField]}"/>
            </apex:repeat>              
            <apex:repeat value="{!$ObjectType.Store__c.FieldSets.Picture_Gallery_Search_Results}" var="pictureGallerySearchResultField">
                <apex:column headerValue="{!$ObjectType.Store__c.Fields[pictureGallerySearchResultField].label}" value="{!pictureGallerySearchResult.Store[pictureGallerySearchResultField]}"/>
            </apex:repeat>
            <apex:repeat value="{!$ObjectType.Visit__c.FieldSets.Picture_Gallery_Search_Results}" var="pictureGallerySearchResultField">
                <apex:column headerValue="{!$ObjectType.Visit__c.Fields[pictureGallerySearchResultField].label}" value="{!pictureGallerySearchResult.Visit[pictureGallerySearchResultField]}"/>
            </apex:repeat>
            <apex:repeat value="{!$ObjectType.Photo_Attachment__c.FieldSets.Picture_Gallery_Search_Results}" var="pictureGallerySearchResultField">
                <apex:column headerValue="{!$ObjectType.Photo_Attachment__c.Fields[pictureGallerySearchResultField].label}" value="{!pictureGallerySearchResult.PhotoAttachment[pictureGallerySearchResultField]}"/>
            </apex:repeat>
        </apex:pageBlockTable>
    </apex:pageBlock>

You can see I’ve created a ‘hard-coded’ hyperlink for an image in the first column, but I want to dynamically hyperlink a field, if it is the name field for a custom object.

For example, if the fieldset…

$ObjectType.Project__c.FieldSets.Picture_Gallery_Search_Results

…contains the a field called ‘Name’, I want to insert a hyperlink that would take you to the salesforce page to view that project.

So firstly I need to be able to determine if the field is a custom object name field and secondly, output a hyper link rather than a label.

If anyone has any ideas, I would be most appreciative.

Thanks for taking the time to read this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:07:08+00:00Added an answer on June 18, 2026 at 5:07 am

    Have you considered doing this logic in an APEX controller/extension? After you execute your query, you can iterate over the results, determine what you want the hyperlink to be for each, and populate a map you expose to your Visualforce page keyed by some unique value in the search result (presumably ID) and the value would be the hyperlink. Then in your Visualforce iterator you can do map[SearchResult.Id] or whatever the key ends up being.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hmm, sounds easy enough but after looking at the ones that come with StringTemplate,
Sounds easy enough but I can't seem to figure this one out or find
Sounds easy, but I've got a bug and I'm not sure what's causing it?
I'm looking for a RichTextBox with syntax highlighting! Sounds easy but I'm searching since
This sounds ridiculously easy, and it is with other shells. But I can't seem
This sounds easy but. I am simply not able to do it. Here is
I need to share data between classes in C#. Sounds easy enough. I have
Sounds easy, but it doest work: I want to remove ALL Content (text and
Sounds easy but when I tried to achieve i'm stock about how is the
I know the title sounds easy but I am looking for an example that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.