Carry out the following steps to override the standard New Account button and replace the new account creation functionality with our custom Lightning Component:
- Click on the Setup gear icon in the top right-hand corner of the main Home page, as shown in the following screenshot:
- Click the Setup option, as shown in the following screenshot:
- Navigate to the Account customization setup page, by clicking Objects and Fields | Object Manager | Account | Buttons, Links, and Actions.
- Locate the Buttons, Links, and Actions section on the right of the page.
- Locate the New button and click on the drop-down arrow selection.
- Click on Edit, as shown in the following screenshot:
- Select the Lightning Component Bundle option.
- Choose c:AccountSearchBeforeCreate in the drop-down selection box.
- Enter This overwrites the new account creation button to present a search screen to the user which requires searching before the option to create a new account record is permitted in the Comment textbox.
- Leave the Skip Record Type Selection Page checkbox unchecked (if shown).
- Click on Save, as shown in the following screenshot: