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
KCBKCB 

Visual Force API Version Error for New Notes

In My Existing VF code I’ve related list "Notes&Attachments" tied to Account
  <apex:relatedList subject="{!account}" list="NotesAndAttachments"   />  

Now i want to replace with Files and Notes.
     <apex:relatedList subject="{!account}" list="AttachedContentDocuments"  />   
      <apex:relatedList subject="{!account}" list="AttachedContentNotes"  />

Issues is with Notes - I’ve to set the API version above 35 in order to identify AttachedContentNotes object. If i do that, I’ll lose access to existing Notes&Attachment on VF Page, since above 36 version are not supported to notes and attachment.

How can i display both Notes&Attachment and AttachedContentNotes ? or what will be an ideal solution, the reason i want Note&Attachments is it has all historical data and other integration ties

Please Suggest,
Thanks In Advance
Best Answer chosen by KCB
Santosh Reddy MaddhuriSantosh Reddy Maddhuri
Hi KCB,

using the following code, you can display Notes & Attachments , Notes and Files.

<apex:page standardController="Account">

<apex:detail relatedList="false" inlineEdit="true" />
<apex:relatedList subject="{!Account}" list="CombinedAttachments"   />  
<apex:relatedList subject="{!account}" list="AttachedContentDocuments"  />   
<apex:relatedList subject="{!account}" list="AttachedContentNotes"   />  

</apex:page>

Here is the screenshot.

User-added image

If this works , Mark it as correct answer !!!
 

All Answers

Santosh Reddy MaddhuriSantosh Reddy Maddhuri
Hi KCB,

Have you enabled enhanced notes using Setup --> Notes --> Notes settings.Please try this and see whether you can keep both of them on the page.
KCBKCB
Yes, I'm able to add to standard page layout and utilize the functionality both old and new features. Only problem with VF page Thanks
Santosh Reddy MaddhuriSantosh Reddy Maddhuri
Hi KCB,

using the following code, you can display Notes & Attachments , Notes and Files.

<apex:page standardController="Account">

<apex:detail relatedList="false" inlineEdit="true" />
<apex:relatedList subject="{!Account}" list="CombinedAttachments"   />  
<apex:relatedList subject="{!account}" list="AttachedContentDocuments"  />   
<apex:relatedList subject="{!account}" list="AttachedContentNotes"   />  

</apex:page>

Here is the screenshot.

User-added image

If this works , Mark it as correct answer !!!
 
This was selected as the best answer
Santosh Reddy MaddhuriSantosh Reddy Maddhuri
The versions i have tested it the code  are 36 & 37
KCBKCB
Thanks Santosh that works!
stafen wangstafen wang
fdg