visualforce Commands

Use the visualforce commands to create Visualforce pages and components.

visualforce:component:create

Creates a Visualforce component in the specified directory or the current working directory. The command creates the .component file and associated metadata file.

Command Syntax

sfdx force:visualforce:component:create
[--json]
[--loglevel LOGLEVEL]
[-t TEMPLATE]
[-d OUTPUTDIR]
-n COMPONENTNAME
[-a APIVERSION]
-l LABEL

Parameters

--json
Optional

Formats output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: warn
-t | --template TEMPLATE
Optional

The template to use to create the file. Supplied parameter values or default values are filled into a copy of the template.

Type: string
Permissible values are: DefaultVFComponent
Default value: DefaultVFComponent
-d | --outputdir OUTPUTDIR
Optional

The directory to store the newly created files. The location can be an absolute path or relative to the current working directory. The default is the current directory.

Type: string
-n | --componentname COMPONENTNAME
Required

The Visualforce component name. The name can be up to 40 characters and must start with a letter.

Type: string
-a | --apiversion APIVERSION
Optional

The API version of the created source.

Type: string
Permissible values are: 45.0, 44.0
Default value: 45.0
-l | --label LABEL
Required

The label saved in the metadata for the Visualforce component.

Type: string

Help for visualforce:component:create

visualforce:page:create

Creates a Visualforce page in the specified directory or the current working directory. The command creates the .page file and associated metadata file.

Command Syntax

sfdx force:visualforce:page:create
[--json]
[--loglevel LOGLEVEL]
[-t TEMPLATE]
[-d OUTPUTDIR]
-n PAGENAME
[-a APIVERSION]
-l LABEL

Parameters

--json
Optional

Formats output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: warn
-t | --template TEMPLATE
Optional

The template to use to create the file. Supplied parameter values or default values are filled into a copy of the template.

Type: string
Permissible values are: DefaultVFPage
Default value: DefaultVFPage
-d | --outputdir OUTPUTDIR
Optional

The directory to store the newly created files. The location can be an absolute path or relative to the current working directory. The default is the current directory.

Type: string
-n | --pagename PAGENAME
Required

The Visualforce page name. The name can be up to 40 characters and must start with a letter.

Type: string
-a | --apiversion APIVERSION
Optional

The API version of the created source.

Type: string
Permissible values are: 45.0, 44.0
Default value: 45.0
-l | --label LABEL
Required

The label saved in the metadata for the Visualforce page.

Type: string

Help for visualforce:page:create