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
Yadhagu LYadhagu L 

From lightning datatable, how to show as lookup URL field and edit, and show the recent records of that related object

Gian Piere VallejosGian Piere Vallejos
To show a lookup field and edit it in the same table, you need to create a new component an set it to your datatable through a Custom Datatable Types.

Here you have an article that do it step by step: https://techdicer.com/lookup-field-in-lwc-datatable-inline-edit/
And a repository: https://github.com/Sarveshgithub/sfdc-lwc-lightning-datatable

Let me know if it helps you.
Arun Kumar 1141Arun Kumar 1141

Hello Yadhagu,

To do this, use the "Related List - Single" component in Salesforce's Lightning Record Page. Configure the component to select the desired related object, set the fields to display, and enable editing if required. Save and activate the Lightning Record Page. Salesforce will generate the datatable with clickable lookup links and show recent records automatically. No custom code is needed.

If above answer helped you ,mark it as best answer.