Lightning Aura Components – Identifying Functions Used with Overwritten New Standard Button

button-overrideslightning-aura-componentsnew

I have successfully overwritten the "New" and "Edit" behavior of a custom object with a lightning aura component. Everything is working fine and if the user clicks the related list new button of the parent Account, I can prepopulate the Account in the component using the AccountId of the URL. So good so far.
Unfortunately, if the user clicks the New record shortcut from the object tab, my component prepopulates the Account too. I need to distinguish if the user has clicked the related list "New" or the "New" of the Object tab.
Any ideas how to achieve this?

enter image description here

Best Answer

Solution: Create a custom Quick Action "New" that will be placed on the related list on the Account object. This custom Quick Action can pass parameters into the LWC and due to this, the LWC can distinguish between a click on the custom Quick Action and the Object "New".

Related Topic