I have a dynamic lwc that generates related lists dynamically. I want to add a New button to the component but want to be able to dynamically get the component from which the new button was clicked so I can get the current object as a property. How do I achieve this or is this not possible in this manner or another way?
Something like:
createNew() {
this[NavigationMixin.Navigate]({
type: 'standard__objectPage',
attributes: {
objectApiName: event.button.cmp.obj,
actionName: 'new'
}
});
}
Thanks in advance.