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
Victor19Victor19 

Notes and Attachments on Visualforce Page - Standard Controller with Extension

Hi,

 

I am trying to add the Notes and Attachments Section on my Visualforce Page and I keep getting the error as below:


'NotesAndAttachments' is not a valid child relationship name for entity Test Object

 

I used   <apex:relatedList subject="{!Test_Object__c}" list="NotesAndAttachments"/>

 

Can someone please suggest or point out my mistake.

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
Saravanan_ChoSaravanan_Cho

 

The relationship name for the Notes and Attachments related list has been changed in winter 14 release.

 

 
use :
<apex:relatedList subject="{!account}"  list="CombinedAttachments" />

instead of :
<apex:relatedList subject="{!account}"  list="NotesAndAttachments" />

 

 

Thanks,

Sarv

All Answers

JonathanBaltzJonathanBaltz
Are Notes & Attachments enabled on the custom object "Test Object?"
Victor19Victor19

Yes! Notes and Attachment is on the Test Object (Custom Object) and the Visualforce Page is for the Test Object (Custom Object)

kevin lamkevin lam

Have you tried removing the subject attribute? You don't need that if you're using a standard controller.

Satish_SFDCSatish_SFDC
Check if the Notes And Attachments related list is present in the standard page layout of the Custom Object.
This seems weird but the related list should be present in the standard page layout.
Check if this resolves your issue.

Hope this helps.
Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Satish_SFDCSatish_SFDC
I also checked the Component Reference of the <apex:relatedlist> component and it says this:
"This does not need to be on an object's page layout"

So, i advise you to create a case to see if this is an error.

Hope this helps.
Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Victor19Victor19
Hi Kevin,

I tested it after removing the subject attribute and I still get the same error!
Victor19Victor19
I do have it on the standard page layout. I don't understand what's happening with the notes and attachments related list. I had no issues displaying the other standard related lists.
SpirusSpirus

Did you find any solution to your problem?

I am dealing with the exact same issue...

Victor19Victor19
Hi Spirus,

I couldn't find a fix for the issue using the standard functionality. I am working on some custom code to include this functionality. Let me know if you come up with a fix for this issue.
SpirusSpirus

Hi Victor,

The weird thing is that for another custom object that I have created in the past it works without any problem.

This issue came up recently when I tried to add the related list in an new custom object...

 

Victor19Victor19

I think it is like a Salesforce issue then! Did it work with a Visualforce Page? I hope they fix it pretty soon!

GranicusJayGranicusJay

I just opened a help ticket with Salesforce and this was their reply. I was getting the "NotesAndAttachments is not a valid related list for {!CustomObject}" error.

 

"The thing you are trying to do works with Salesforce.com API version upto 28.0. This is no longer supported with Api version 29.0. Though it's not documented in Winter' 14 release notes but we have filed to update the release notes to incorporate this change."

 

OUTRAGE!

Victor19Victor19
Hi Jay,

Thanks for the update.

This is going to be a big issue for us! For such a simple functionality, a lot of code has to be written and maintained - completely unnecessary.

I have written code for this functionality, but i keep getting weird errors every time whenever I try attaching more than 1 file. I guess I will have to work on my code then :(
SpirusSpirus

This is unbelievable...Are they retarted???Sorry for my language but I cannot find any reason why they could do that...They are supposed to make our lives easier and now we need to write code to support this functionality...

Saravanan_ChoSaravanan_Cho

 

The relationship name for the Notes and Attachments related list has been changed in winter 14 release.

 

 
use :
<apex:relatedList subject="{!account}"  list="CombinedAttachments" />

instead of :
<apex:relatedList subject="{!account}"  list="NotesAndAttachments" />

 

 

Thanks,

Sarv

This was selected as the best answer
Victor19Victor19
Thanks Sarv! That fixed my issue of Custom coding the notes and attachments section. I appreciate your help!
vivekanandanvivekanandan
Hi ,

I am able to create notes and attachment related list, but the problem now is in Account record, I am able to see the contacts notes and attachments also. (parent , child). I dont want to see the contact records in account related list.. Any body please suggest.
neha namaneha nama
we referenced <apex:relatedList subject="{!Account}" list="CombinedAttachments" /> on visualforce page and our page will be usedin lightning experience. But the problem with this retated list is, when we click on attach file in it : A new window opens and there are option to upload and attach file and finally to click on 'Done'. When I click on Done I got a blank screen rather than previos detail page. Do anyone have workaround regarding this.
 
Sidharth Panda 5Sidharth Panda 5
@Neha - I just ran into this issue today. Can you please let me know what workaround you implememted?
Chaithanya Thatikonda 1Chaithanya Thatikonda 1
Great:)@ Sarv