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
prasad@s.ax832prasad@s.ax832 

Best way to display a custom related list on a child object.

a) There is an Object  "CarTestDrive"

b) There is an Object  "Car" (Diff record types like Porsche/Ford/GM/Toyota)

c) There is an Object "TestDriver"

 

Both 'Car' and 'TestDriver' have a lookup relationship to "CarTestDrive"

Car has a field called "Number of Times", which means the number of times the 'testDriver' has to test drive.

 

Now when i am creating a Car object of record type say 'Porsche',  I also need to associate a 'TestDriver' to the ''Car' object.

At the click of save button from the Car edit page, I will probably fire a trigger to auto create as many instances specified by the 'Number Of Times' field in 'TestDriver' and associate them to the 'TestDriver' object.

 

*******Query**********

 After the creation process I want to display them as part of a related list in 'TestDriver' detail page. Where the related list should show all the added 'Car' instances and show a couple of columns from the car instance in the related list.

 

I am relatively new to the developer apps on the platform, i went through the documentation and found that controller extension is one of the ways to solve the above problem, but i was not so sure.

Can some one please suggest the most efficient way to go about implementing this?

 

Thank you.

Ispita_NavatarIspita_Navatar

Few things to clarify before I can answer:-

 

1. Where do you want to display the related list :-

      a) Standard detail page (if it is a standard detail page then the object of related list just needs to be linked via lookup field and you need to add the related list to the pagelayout)

      b) Custom VF page (If it is a custom VF page then there are 2 things do you want to use to use the built in related list, if yes then for that you have to use the VF tag for related list, in case the whole related list you want to show is custom then it is has to be done via code)

 

 

But since salesforce gives this facility of related list for objects linked via master-detail or lookup relationships it is ideal to reuse the standard functionality.

Did this answer your question? If not, let me know what didn't

work, or if so, please mark it solved.