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
Chetna AgrawalChetna Agrawal 

how to display note related list in visualforce page

i want related list for notes which contain new note button on lead detail page.
<apex:page standardController="Lead">
    <apex:pageBlock >
    {!Lead.name}:
    </apex:pageBlock>
    <apex:relatedList subject="{!Lead}" list="CombinedAttachments" />
     <apex:relatedList list="Note" />
</apex:page>
it is not working.
SonamSonam (Salesforce Developers) 
Chetna,

You should be using the below tag to get Notes related list:
<apex:relatedList list="AttachedContentNotes"/>

reference:
https://developer.salesforce.com/forums/?id=906F00000005GshIAE
 
Chetna AgrawalChetna Agrawal
Thanks sonam, now i am able to see notes and new note button.
but after click on new note button i am getting error like "Action you performed was invalid for session.
SonamSonam (Salesforce Developers) 
Good to know the related list is available on VF.

The resolution to the session error is explained in the link below:
https://help.salesforce.com/apex/HTViewSolution?urlname=New-Note-button-on-the-notes-and-attachments-related-lists-results-in-invalid-session-error&language=en_US

Pls try it out.
Chetna AgrawalChetna Agrawal
thanks for reply,
i have enabled feed tracking but it is not working, still i am getting the same error.
SonamSonam (Salesforce Developers) 
Chetna,

Can you please share your updated VF code in the thread? I will try it out in my dev org.
Akhilesh DahatAkhilesh Dahat

Hello Sonam,

I tried with two approaches after switches to lightning mode

<apex:relatedList  subject="{!account}" list="OpenActivities" /> - "We couldn't find the record you're trying to access. It may have been deleted by another user, or there may have been a system error. Ask your administrator for help"

<apex:relatedList list="AttachedContentNotes" />   -- "The action you performed was invalid for your session. Please refresh your page and try again."