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
csidesinternapcsidesinternap 

related lists for opportunities

OK so I know this may be a super basic question but I can't figure it out and I can't find a reference anywhere that gives me the proper syntax for related lists.  I have built a mashup using VF using the Opportunity standard controller and I want to add several of the opportunity related lists at the bottom of the page.  I was able to use examples I had seen and add the activities and the notes and attachments lists but for the life of me I can't figure out what the names are for the Competitors and Contact Roles lists are. 

 

I know this works for Notes & Attachments:

 

<apex:relatedList list="NotesAndAttachments"/>

 

so I tried the following but none of them work:

 

<apex:relatedList list="Competitors"/>

<apex:relatedList list="OpportunityCompetitors"/>

 

and

 

<apex:relatedList list="Competitor"/

<apex:relatedList list="Competitors"/>

<apex:relatedList list="OpportunityCompetitor"/>

 

Also once I have the lists added, does anyone have sample VF code for how to control what columns appear in the lists?

Best Answer chosen by Admin (Salesforce Developers) 
prageethprageeth

Hello 

 

The following syntax you already have tried is correct

<apex:relatedList list="OpportunityCompetitors"/> 

 

For contact roles you can use the below syntax.

<apex:relatedList list="OpportunityContactRoles"/> 

 

If you want to know other List Names see the ChildRelationships for Opportunity table in Apex Explorer. 

 

All Answers

prageethprageeth

Hello 

 

The following syntax you already have tried is correct

<apex:relatedList list="OpportunityCompetitors"/> 

 

For contact roles you can use the below syntax.

<apex:relatedList list="OpportunityContactRoles"/> 

 

If you want to know other List Names see the ChildRelationships for Opportunity table in Apex Explorer. 

 

This was selected as the best answer
csidesinternapcsidesinternap
Perfect, thanks.  The Force Explorer is exactly what I was looking for!