I am looking for combining notes and attachments related to 2 different objects in 3rd object.

Object1 has related list of notes and attachments and Object2 has related list of notes and attachments.

I have created 2 visualforce pages related to Object3 and added those in separate section But how do I combine those 2 relatedlist.

Note - both object1 and object2 have realated List's list attribute value ="CombinedAttachments"

  • I worked with custom VF and apex controller extension and it worked. Sorry - I am not sure about exposing code here (Don't know the company policy) – Sandeep Patwardhan Mar 17 '17 at 21:18
  • Sandeep, check the How to Ask page. It will be nearly impossible to help without code. Most places will let you post excerpts of code, though some people simply either use pseudo code or real code (simplified) with changed object names. – Sebastian Kessel Mar 17 '17 at 21:27
  • I am new to it. I will keep that in mind next time. Thanks – Sandeep Patwardhan Mar 21 '17 at 20:13

You won't be able to use apex:relatedList to combine other objects related lists. The standard related list component relies on the StandardController for the page's record, and due to only the third object being present in the StandardController, it'll only show that objects records.

There are ways around this, but they will rely on apex and visualforce. By creating a custom visualforce component, you can style it identical to the related lists on the page, and provide the other object ids for use in the component to filter your data appropriately.

If this is a road you want to go down, try the Visualforce Trailhead if you haven't, and ask a new question if you run into issues with developing your own component.

| improve this answer | |
  • I tried creating custom visualforce page and added it to the layout and it worked perfectly. I used Notes and Attachments objects and created 2 page block tables to show it similar to the existing ones. – Sandeep Patwardhan Mar 17 '17 at 21:16
  • If this answer helped you, consider marking it as accepted. That way, others who come to this question will be able to tell that this answer helped you. – battery.cord Mar 20 '17 at 12:55

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.