Is it possible to have all the 'Notes and Attachments' from the Account Object to be displayed on each subsequent Opportunity it is related to automatically- similar to a related list?

Also, is it possible to display all the contacts that were entered on the account level to show up on each related Opportunity that is created? Our environment does not use the Contact Roles. Thank you guys in advance!

  • 2
    No. Not without creating and inline VF page to display such items – Eric Jul 28 '15 at 18:58

The easiest way would be to use a visualforce page section to your opportunity page layout. You can use something along these lines with a standard controller:

<apex:page standardController="Opportunity" showHeader="false" tabStyle="Opportunity" 
       showQuickActionVfHeader="false" showChat="false">

       <apex:relatedList subject="{!Opportunity.Account}" list="CombinedAttachments"/>

This will allow you to view the notes and attachments from the account (by taking advantage of the lookup relationship of opportunity to account). More information on related lists in Visualforce can be found here. The same kind of page could be used to find information the account from the child contact.

Here is what it looks like in my sandbox:

enter image description here enter image description here

  • Thank you for this script! I tried it out in sandbox but received the below error Error: Cyclic page or component references '/apex/Show_Contacts_Notes_Attachments' are not allowed – JazzyJ Jul 28 '15 at 19:30
  • Odd I just tested it in my sandbox and it worked fine. Where are you getting the error? – Jason Hardy Jul 28 '15 at 19:39
  • The error message comes up before I can even save the Visual Force Page – JazzyJ Jul 28 '15 at 19:51
  • Are you using the code exactly as specified or are you doing something else with it (e.g. putting it into a component or another page). I looked around quickly and it looks like such an issue comes up when you have two <apex:page> tags – Jason Hardy Jul 28 '15 at 19:54
  • Looks like it works now! but i am only able to add it to a random section on the layout not to a related list, correct? Also, could please help with the Contacts now instead of notes & attachments – JazzyJ Jul 28 '15 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.