Available in: Salesforce Classic and Lightning Experience
Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
To create, edit, and set version settings for Visualforce pages:
You can create Visualforce pages either by using Visualforce development mode, or by creating pages in Setup.
To create a page using the “quick fix” tool available in Visualforce development mode:
In your browser, enter a URL in the following form: https://mySalesforceInstance/apex/nameOfNewPage, where the value of mySalesforceInstance is the host name of your Salesforce instance (for example, na3.salesforce.com) and the value of nameOfNewPage is the value you want to give to the Name field on your page definition.
For example, if you want to create a page called “HelloWorld” and your Salesforce organization uses the na3.salesforce.com instance, enter https://na3.salesforce.com/apex/HelloWorld.
Page names can’t be longer than 40 characters.
Because the page does not yet exist, you are directed to an intermediary page from which you can create your new page. Click Create page nameOfNewPage to create the new page. Both the page Name and Label are assigned the nameOfNewPage value you specified in the URL.
To create pages in Setup:
From Setup, enter Visualforce Pages in the Quick Find box, then select Visualforce Pages.
In the Name text box, enter the text that should appear in the URL as the page name. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
In the Label text box, enter the text that should be used to identify the page in Setup tools, such as when defining custom tabs, or overriding standard buttons.
In the Name text box, enter the text that should be used to identify the page in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
In the Description text box, specify an optional description of the page.
Select Available for Salesforce mobile apps to enable Visualforce tabs associated with the Visualforce page to be displayed in the Salesforce1 app. This checkbox is available for pages set to API version 27.0 and later.
Standard object tabs that are overridden with a Visualforce page aren’t supported in Salesforce1, even if you select the Available for Salesforce mobile apps option for the page. The default Salesforce1 page for the object is displayed instead of the Visualforce page.
This option has no effect on Visualforce support in the Salesforce Classic Mobile mobile app. Instead, use the Salesforce Classic Mobile Ready checkbox on Visualforce Tab setup pages.
Select Require CSRF protection on GET requests to enable Cross Site Request Forgery (CSRF) protection for GET requests for the page. When checked, it protects against CSRF attacks by modifying the page to require a CSRF confirmation token, a random string of characters in the URL parameters. With every GET request, Visualforce checks the validity of this string of characters and doesn’t load the page unless the value found matches the value expected.
Check this box if the page performs any DML operation when it’s initially loaded. When checked, all links to this page need a CSRF token added to the URL query string parameters. This checkbox is available for pages set to API version 28.0 and later.
In Summer ’13, the only way to add a valid CSRF token to a URL is to override an object’s standard Delete link with a Visualforce page. The Delete link will automatically include the required token. Don’t check this box for any page that doesn’t override an object’s standard Delete link.
In the Visualforce Markup text box, enter Visualforce markup for the page. A single page can hold up to 1 MB of text, or approximately 1,000,000 characters.
Click Version Settings to specify the version of Visualforce and the API used with this page. You can also specify versions for any managed packages installed in your organization.
Click Save to save your changes and return to the Visualforce detail screen, or click Quick Save to save your changes and continue editing your page. Your Visualforce markup must be valid before you can save your page.
Though your Visualforce markup can be edited from this part of Setup, to see the results of your edits you have to navigate to the URL of your page. For that reason, most developers prefer to work with development mode enabled so they can view and edit pages in a single window.
Once your page has been created, you can access it by clicking Preview. You can also view it manually by entering a URL in the following form: http://mySalesforceInstance/apex/nameOfNewPage, where the value of mySalesforceInstance is the host name of your Salesforce instance (for example, na3.salesforce.com) and the value of nameOfNewPage is the value of the Name field on your page definition.