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 8073545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:22:09+00:00 2026-06-05T14:22:09+00:00

I’m new to Salesforce and I was looking into making a page layout for

  • 0

I’m new to Salesforce and I was looking into making a page layout for Leads/Contacts/Accounts to have special owner visibility.

I have the detail page looking as needed using Standard Salesforce page layouts, but am wondering how can I show or hide a section of the layout based on whether the viewing User is the Owner of the record.


Desired Scenario:

Record R is owned by User A. Detail Page for Record R is a Standard Salesforce Page Layout with 2 sections: one section containing Contact info (that ONLY User A, the owner, can see), and one section containing additional info (that ALL users can see).


I have reviewed the documentation and from what I can see the only way is to either build a custom controller or extension. Is this the only way and if so, does anyone have a good walkthrough in changing only a section of a page layout rather than creating an entirely new page?

  • 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-05T14:22:10+00:00Added an answer on June 5, 2026 at 2:22 pm

    Your best option (Approach 1) is to separate your fields into FieldSets (see Working with Field Sets in Visualforce ) and then override the detail page using a Visualforce Page that uses those FieldSets to determine which fields to display AND only shows certain FieldSets if the User viewing the page is the Owner of the record. This approach requires no custom controller / extension, allows you to hide various sections of your page to non-Owners, and allows you (or another admin) to modify the fields in each section going forward using the drag-and-drop FieldSet editor, which is very similar to the Drag-and-Drop Page Layout editor.

    Another method (Approach 2) that also requires no custom controller / extension would be to create a Visualforce Page that contains the fields you only want to show to the owner, and then only render these fields if the running user is the record owner. YOu can then add this Visualforce Page to your Page Layout. The reason I don’t recommend this approach is that it is a pain to get the styling of the fields in this Page to match up with the rest of the standard page layout.

    Just FYI, there is no straightforward way (read: without JavaScript hacks) to show/hide sections of a standard Page Layout without using Visualforce.

    APPROACH 1:

    <apex:page standardController="Contact">
         <!-- Fields everyone should see -->
         <!-- (stored in the 'FieldsEveryoneSees' fieldset) -->
         <apex:repeat value="{!$ObjectType.Contact.FieldSets.FieldsEveryoneSees}" var="f"> 
             <apex:outputField value="{!Contact[f]}" /><br/>
         </apex:repeat>
         <!-- Fields only the Owner should see -->
         <!-- (stored in the 'OwnerOnlyFields' fieldset) -->
         <apex:repeat value="{!$ObjectType.Contact.FieldSets.OwnerOnlyFields}" var="f"
                  rendered="{!$User.Id == Contact.OwnerId}"> 
             <apex:outputField value="{!Contact[f]}" /><br/>
         </apex:repeat>
    </apex:page>
    

    APPROACH 2:

    <apex:page standardController="Contact" showHeader="false" sidebar="false">
         <apex:outputPanel rendered="{!Contact.OwnerId == $User.Id}">
              <!-- Fields only the Owner should see -->
              <apex:outputField value="{!Contact.LastModifiedDate}"/>
              <!-- etc... -->
         </apex:outputPanel>
    </apex:page>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm making a simple page using Google Maps API 3. My first. One marker
I have two tables with like below codes: Table: Accounts id | username |
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.