Usage Of force:recordView

A force:recordView component represents a read-only view of a record. By default, the record view uses the full layout to display all fields of the record. The type attribute does not support any other value so you don’t need to specify it. In this example, we will see how to use the force:recordview along with datatable. we will show the row details on click of the row action by using force:recordview

Apex Class 

 

Lightning Component 

Here is the simple lightning component

controller.js

helper.js

Key highlights of the code 

The following code is used to show the row-level action on datatable

Below controller handler is used to handler the row level actions.

the following controller action logic is used to create a force:recordview and passes the record id to the record view based on the row action.