+ Start a Discussion
Pratima Shrivastav 3Pratima Shrivastav 3 

Override new on related list

Hi,
I'm trying to create  a lightning component to override the new button of a custom object 'C' whoch is child of two diferent objects 'A' and 'B'. The reason I need to override it because 'C' has two record types 'a' and 'b' and when user seect 'new' from the related list , it takes them to a page for recordtype selection. What I need is when they are on record page of A, it should directly take them to page layout of recordtype 'a' when they click on New button and similar for record page B.
    I have already tried using lightning quick action (only customization) required and that does the job perfectly but I cant place it on related list, it has to be placed on top right of the lightning record page.
   I have put together some code for the component but there is something strange. While overriding, even if I select the checkbox 'Skip recordtype selection', it still takes me to the page. as anyone faced this or knws a solution for this? That would be really helpful.
Alba RivasAlba Rivas
Hi,

You should be able to override the new action directly. Your component should implement lightning:actionOverride interface.
Check this blog: https://andyinthecloud.com/2017/05/30/overriding-standard-actions-with-lightning-components/

Hope that helps.
Regards.

 
Pratima Shrivastav 3Pratima Shrivastav 3
Thank you for your reply and I have already been through that link you sent me. My component is implementing lightning:actionOverride interface but it is still taking me to the recordtype select page. Do you hink it is some kind of flaw?
Alba RivasAlba Rivas
Oooops I misunderstood your question then. I understand it now. I think several people have the same problem:

https://salesforce.stackexchange.com/questions/185589/lightning-component-overrides-new-standard-action-with-different-record-type

Sadly it seems like a bug :(
Pratima Shrivastav 3Pratima Shrivastav 3
That’s alright. Hmm I am facing exactly the same issue. Weird part is it only happens on related list new but when I go to the object and click new it doesn’t take me to that page. Thank you