function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lakshmi SLakshmi S 

How to override Account Standard New button with LWC component?

Hi Team,

I have created a custom LWC component for Account records. I want to override the Account Standard New button with a custom LWC component.
Can anyone help me with this how-to achieve this?

Thanks in advance.
Lakshmi.
Best Answer chosen by Lakshmi S
Suraj Tripathi 47Suraj Tripathi 47
Hi,
In LWC you cannot override the standard button action, but this can be done by wrapping your component in the aura component.
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global" >

Use the below link to get more details:-
https://trailhead.salesforce.com/content/learn/projects/workshop-override-standard-action/override_4

Please mark it as Best Answer if it helps you.

Thanks & Regards
Suraj Tripathi

All Answers

Suraj Tripathi 47Suraj Tripathi 47
Hi,
In LWC you cannot override the standard button action, but this can be done by wrapping your component in the aura component.
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global" >

Use the below link to get more details:-
https://trailhead.salesforce.com/content/learn/projects/workshop-override-standard-action/override_4

Please mark it as Best Answer if it helps you.

Thanks & Regards
Suraj Tripathi
This was selected as the best answer
AbhinavAbhinav (Salesforce Developers) 
Hi Lakshimi,

Currently Override standard button using Lightning Web Component (LWC) is not available.
Refer below Idea link
https://trailblazer.salesforce.com/ideaView?id=0873A000000LqZIQA0

However, you can use aura  to call your lwc componenet to achieve this
Kindly refer below link.
https://salesforce.stackexchange.com/questions/273505/override-standard-action-with-lightning-web-component


Hope above answer was helpful, Please mark as best answer so that it can help others in future.

Thanks!