Contents
Also was hoping to go declarative and assign a quick action to override a standard button, but alas this was not an option either. Back to the drawing board. Embeded LWC in Aura component is not funny.
Till Spring 16, we do not have ability to override standard buttons with lightning component. ( Ofcourse we have an ability to override standard button with visualforce page and we can embed lightning component. But some of the features are not available in Lightning components created via visualforce pages).
How to override standard new button in Salesforce.com?
Now, to override the standard new button action Go to >SETUP > OBJECT MANAGER > Buttons, Links, and Actions > Goto New > Click Edit. Override the Lightning experience and Mobile view with the Lightning component.
To get Record ID if component was called from override New button i do workaround with RecentlyViewed table. If you found better way, please share. implements=”lightning:actionOverride,force:hasRecordId,force:hasSObjectName” By using that you can override that Standard Action.
Here we are going to override the standard New button in Account object with a sample custom lightning component. “message”: “Account created successfully.” Go to Setup >> Object Manager >> Account >> from Buttons, Links and Actions section edit standard button [for this i have override New button]
How to override new action on related list?
Project for client required solution for a related list (–child junction object). So requirement is override New action on related list. Right now using VF page with a controller. Solution works by assigning APEXPAGE.currentpage.getparameters () to a map and looping through keyset () of this map looking for the ‘CFxxxxxxx_lkid’ pattern.