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
Saad Ahmad 33Saad Ahmad 33 

Trying to rename the standard notes and attachments section on a custom object called "Publisher Site" - What is wrong with my VisualForce Code here?

User-added image
<apex:page standardController="Publisher_Site">
  <apex:relatedList list="notesandattachments">
    <apex:facet name="header">
      <apex:outputPanel>
        <apex:outputText value="Rate Cards and Media Kits"></apex:outputText>
        <apex:form>
          <apex:commandButton value="A Note" action="URL_OR_ACTION_METHOD"></apex:commandButton>
        </apex:form>
      </apex:outputPanel>
    </apex:facet>
  </apex:relatedList>
</apex:page>

 
NagendraNagendra (Salesforce Developers) 
Hi Ahmad,

Here's a sample example of how to override the header with a standard object which works absolutely fine for me.
<apex:page standardController="account">
  <apex:relatedList list="notesandattachments">
    <apex:facet name="header">
      <apex:outputPanel>
        <apex:outputText value="My Notes"></apex:outputText>
        <apex:form>
          <apex:commandButton value="A Note" action="URL_OR_ACTION_METHOD"></apex:commandButton>
        </apex:form>
      </apex:outputPanel>
    </apex:facet>
  </apex:relatedList>
</apex:page>
I don't see anything wrong in the code.

May I suggest you please double check with the API name of the custom object which might be causing the issue?

Also, can you post the screenshot of the custom object detail page so that we can look into it and do the needful?

Hope this helps.

Mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks,
Nagendra

 
Saad Ahmad 33Saad Ahmad 33
Thanks Nagendra. The API name is correct ...see attached screenshot - same error coming up "

Error: <apex:component> is required and must be the outermost tag in the markup at line 1 column 1

User-added image

User-added image
Saad Ahmad 33Saad Ahmad 33
Thanks Nagendra. The API name is correct, please see screenshots below - still same error message coming up

Error: <apex:component> is required and must be the outermost tag in the markup at line 1 column 1

User-added image

User-added image