function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AlexYAlexY 

Site Authorisation Error when Created By And Last Modified By added to site VF page

I have created a very simply VF page for a site only using a standard controller

 

When I use <apex:detail>, the site renders as expected and the Created By and Last Modified By fields are visible to the site user.

 

If, however, I choose to be more creative with my page and add those fields as <apex:outputfield>, I get a site authorisation error.

 

Can anybody shed some light on this?

 

<apex:page standardController="Technical_Engagement_Comments__c" sidebar="false">

    
    
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:outputField value="{!Technical_Engagement_Comments__c.name}"/>
            <apex:pageBlockSectionItem />
            <apex:outputfield value="{!Technical_Engagement_Comments__c.TE_Sub_Task__c}"/>
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:outputField value="{!Technical_Engagement_Comments__c.Comments__c}"/>
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:outputField value="{!Technical_Engagement_Comments__c.CreatedBy}" />
            
        </apex:pageBlockSection>
    </apex:pageBlock>
    
    
    <!--apex:detail /-->

</apex:page>