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
Dev RaulDev Raul 

Build a Query in a component to get related records

Hi All,
I would like to create a component in a visualforce page and put them on  record page.
This component should allow me to make a query on related records and select the fields I want of the object related to that record.
The component should know what kind of object/record it has been placed in, and get related objects.
When I click on search, the results would be displayed in another visualforce page with the detailed results list.

Do someone ever made something like this? Any proposal about?

Thank you very much, your help will be very appreciated.

Raul
PriyaPriya (Salesforce Developers) 

Hi Dev,

Please refer the below link that matches your requirement and modify your code accordingly :-

https://www.sfdckid.com/2019/08/salesforce-lightning-component-to-display-contacts.html

https://salesforce.stackexchange.com/questions/226178/can-you-include-a-related-list-in-a-lightning-component-similar-to-visualforce

 

If you find the above information helpful, please mark it as best answer.

Regards,

Priya Ranjan