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
[-t TEMPLATE]
[-d OUTPUTDIR]
-n COMPONENTNAME
[-a APIVERSION]
-l LABEL
[--json]
[--loglevel LOGLEVEL]

Parameters

-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: 41.0, 40.0
Default value: 41.0
-l | --label LABEL
Required




The label saved in the metadata for the Visualforce component.

Type: string
--json
Optional




Formats output as JSON.

Type: string
--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: error

Help for visualforce:component:create

If not supplied, the apiversion, template, and outputdir use default values.

The outputdir can be an absolute path or relative to the current working directory.

Name and label are required.

Examples:

1$ sfdx force:visualforce:component:create -n mycomponent -l mylabel
1$ sfdx force:visualforce:component:create -n mycomponent -l mylabel -d components

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
[-t TEMPLATE]
[-d OUTPUTDIR]
-n PAGENAME
[-a APIVERSION]
-l LABEL
[--json]
[--loglevel LOGLEVEL]

Parameters

-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: 41.0, 40.0
Default value: 41.0
-l | --label LABEL
Required




The label saved in the metadata for the Visualforce page.

Type: string
--json
Optional




Formats output as JSON.

Type: string
--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: error

Help for visualforce:page:create

If not supplied, the apiversion, template, and outputdir use default values.

The outputdir can be an absolute path or relative to the current working directory.

Name and label are required.

Examples:

1$ sfdx force:visualforce:page:create -n mypage -l mylabel
1$ sfdx force:visualforce:page:create -n mypage -l mylabel -d pages