Add a Form to the Visualforce Page
Data in Visualforce
Visualforce pages are so versatile and display data to fit your needs. The customized pages are like a fun plug-and-play web page. You can add Visualforce pages to Lightning pages as a component or replace standard pages with a custom Visualforce page as a user interface.
Let’s replace the standard record page called “New” with the new Visualforce page on the Contact object.
Replace Standard Page with Visualforce Page
In Salesforce, you override buttons, links, and even pages by overriding those properties directly in the object. You can also use Lightning Components to further customize the user experience in your Salesforce org.
- In your playground, click Setup
.
- From Setup, click Object Manager and select Contact.
- Select Buttons, Links, and Actions.
- For the New > NewContact standard page, click the dropdown arrow and select Edit.
- Select the override property Visualforce Page and select your new ContactForm page from the dropdown list.
- Click Save. The standard page for adding new contacts is now replaced with your Visualforce page.
Test the New Visualforce Page
You’ve worked hard at building this new Visualforce page. It’s time to put it to the test and create a new record.
- From the App Launcher
, find and open Sales.
- Click the Contacts tab.
- Click New. Behold your new Visuaforce page in action!
- Enter in any contact information you like.
- Click Save. The page will redirect you to the standard contact record.
Summary
Congratulations! You created a simple Visualforce page form to add new contacts with your new Visualforce page. You can continue to develop this page out and customize it to best fit your needs.