I have created a "New" button in a component on a record page.
<div slot="actions">
<lightning-button label="New" slot="actions" onclick={navigateToNew}></lightning-button>
</div>
The button points to a NavigationMixin that opens a popup for creating a new child-detail record for the record they are currently looking at:
navigateToNew() {
this[NavigationMixin.Navigate]({
type: 'standard__objectPage',
attributes: {
objectApiName: this.objectName,
actionName: 'new'
}
});
}
Once the user saves the new child-detail record, however, they are directed to the new child-detail record page, and I would like them to remain on the original parent-master record page on which they started.
Basically, the idea is to create detail records from a master record without leaving the master record detail page. I don't see anything like this in the documentation - https://developer.salesforce.com/docs/component-library/bundle/lightning-navigation/documentation - is it just not possible using the 'standard__objectPage' type?
Many thanks