Add Database Trigger to Populate Account.Name
- In Salesforce launch the Developer Console (in the Setup symbol in the top right).
- Select File>New>Apex Trigger.
- Enter Name as AccountName.
- Enter sObject as Account
-
Enter as the trigger
trigger AccountName on Account (before insert, before update) { for (Account a: Trigger.new){ a.Name = a.BillingFirstName__c+' '+a.BillingLastName__c; } } - Launch the Developer Console (in the Setup symbol in the top right).
- Select File>New>VisualForce Page.
- Enter Name as BillMaxAccount.
-
Enter for the page
<apex:page standardController="Account" action="{!URLFOR($Action.Account.New,null,[acc2='<ignore>'],true)}"> </apex:page> - Click Setup>Object Manager.
- Select Account.
- Select Buttons, Links, and Actions.
- Find New and choose Edit action.
- Click on the radio button for Visualforce page and Save.
- Select the custom page BillMaxAccount.
- Click SAVE.