We have a requirement where we have built a lightning app page(flexi page) and it has a LWC card component with a button in it. If the user clicks the button it is suppose to open a lightning record page. The requirement is to open the record page in the same tab as of the app page or we can choose home page. We are not able to open the record page in the same tab rather it opens up in a new tab in salesforce nav bar and this new tab can be closed as it has a x icon with it.
This is the code we are using for navigation in LWC
navigateToRecordPage() {
this[NavigationMixin.Navigate]({
type: 'standard__recordPage',
attributes: {
recordId: 'a1S01000001ZrsTRAS',
objectApiName: 'xyz__MyCustomObject__c', // replace with object api name
actionName: 'view'
}
});
}
Please let us know if it is possible to achieve this?
lightning-record-form
(though this does not show the object's flexipage, just uses the page layout for the object to show data).