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
neblincneblinc 

Creating custom related list

Hello,

I'm trying to create a new related list. This list will show certain information (billing start/end date, value, etc..) in a list split by certain pre-defined periods. This list will appear in opportunity page.

To accomplish this - should I create a new custom object, define fields, etc.. Am I doing the right thing? also, how do I retrieve the oppurtunity information. When trying to add related object, I cannot find oppurtunity object? Also, where do i add custom code to do some data modifying before creating a record. 

 

I would appreciate any example or pointer to doc related to this? 

I've spend some time wandering around in the docs and community and got nowhere. 

 

 

-Chandra. 

Best Answer chosen by Admin (Salesforce Developers) 
EnthEnth

Hi Chandra,

 

Whoah, lots of questions. Suggest you look at the Visualforce developers guide around creating an extension controller.

 

If you want to put this custom related list page on Opportunity you need to specify Opportunity as your standard controller and use your extension class to define the getter/setter methods you require. Suggest you work through the tutorial first.

 

Enth

All Answers

EnthEnth

Hi Chandra,

 

Whoah, lots of questions. Suggest you look at the Visualforce developers guide around creating an extension controller.

 

If you want to put this custom related list page on Opportunity you need to specify Opportunity as your standard controller and use your extension class to define the getter/setter methods you require. Suggest you work through the tutorial first.

 

Enth

This was selected as the best answer
neblincneblinc
Thanks. This helps me move forward. I'm a noob to salesforce customizations and so I had this many questions. I'll work thru the guide and reply back on the result.
hansen06hansen06

I have been searching the boards all day on how to do this - in case anyone else comes across this when searching 'create custom related list in SFDC' on Google, this is the first one that comes up.

 

Here is how I solved:

 

Create new custom object. 

 

When complete – click on your custom object name to edit it.  In ‘custom fields & relationships’ of the object – select ‘master-detail relationship’ and associate the object with the ‘primary’ place you want to see it as a ‘related list’ and will associate the object with accounts / opportunities / etc.

 

Once that’s done, create the appropriate custom fields within the object with drop downs, and other values that you want to see in the related list or SFDC section.  When you are done, save it.

 

Once this is all done, go to your page layout, click edit, then go to ‘related list’ – voila there is your newly created related list which you can now add to your page.

SAHG-SFDCSAHG-SFDC
Can we do this using the standard objects too?