0% found this document useful (0 votes)
60 views2 pages

Salesforce CLI Day 2

The document discusses several Salesforce CLI commands used to manage metadata source files including: 1. force:source:convert converts source files to Metadata API format for deployment. 2. force:source:delete removes components from orgs without source tracking. 3. force:source:ignored:list shows ignored files and directories. 4. force:source:manifest:create generates a manifest file listing metadata components. 5. force:source:open previews Visualforce and Lightning pages. 6. force:source:pull retrieves changes from an org to the local project. 7. force:source:push deploys local changes to an org.

Uploaded by

reilyshawn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views2 pages

Salesforce CLI Day 2

The document discusses several Salesforce CLI commands used to manage metadata source files including: 1. force:source:convert converts source files to Metadata API format for deployment. 2. force:source:delete removes components from orgs without source tracking. 3. force:source:ignored:list shows ignored files and directories. 4. force:source:manifest:create generates a manifest file listing metadata components. 5. force:source:open previews Visualforce and Lightning pages. 6. force:source:pull retrieves changes from an org to the local project. 7. force:source:push deploys local changes to an org.

Uploaded by

reilyshawn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Day 2

Source-formatted files: The human-readable and editable representation of metadata


components in a Salesforce DX project, stored in version control for development and
customization, is referred to as source-formatted files.

Metadata API-Formatted: Metadata files in the Metadata API are typically XML-based and
keep to Salesforce-defined XML schemas. These XML files contain the metadata information
needed to create or modify specific Salesforce components.

Commands:

1. Force:source:convert: The command "force:source:convert" is used to convert


source-formatted files in a Salesforce DX project into Metadata API-formatted files. This
conversion is required if you want to use the Metadata API to deploy your changes to a
Salesforce organization.

Examples:

1. sfdx force:source:convert -r path/to/source

2. sfdx force:source:convert -r path/to/source -d path/to/outputdir


-n 'My Package'

2. Force:source:delete: Use this command to delete components from orgs that don’t have
source tracking. To remove deleted items from scratch orgs, which have change tracking, use
"sfdx force:source:push".

Examples:

1. sfdx force:source:delete -m <metadata>

2. sfdx force:source:delete -p path/to/source

3. Force:source:ignored:list: The "force:source:ignored:list" command is a Salesforce CLI


(SFDX) command that lists the files and directories that Salesforce DX is currently ignoring for
source tracking and deployment.

Example:

1. force:source:ignored:list

4. Force:source:manifest:create: Create a project manifest that lists the metadata


components you want to deploy or retrieve.

Examples:
Day 2

1. sfdx force:source:manifest:create -m ApexClass

2. sfdx force:source:manifest:create -m ApexClass:MyApexClass --


manifesttype destroy

3. sfdx force:source:manifest:create --sourcepath force-app --


manifestname myNewManifest

4. sfdx force:source:manifest:create --fromorg [email protected] --


includepackages unlocked

5. Force:source:open: The "force:source:open" command in Salesforce CLI can be used to


open specified Lightning Page files in the Lightning App Builder, as well as preview Visualforce
pages in the default browser.

Examples:

1. sfdx force:source:open -f path/to/source

2. sfdx force:source:open -r -f path/to/source

3. sfdx force:source:open -f path/to/source -u [email protected]

6. Force:source:pull: The "force:source:pull" command is used to retrieve changes from your


Salesforce org and update the metadata in your local project. If there are any conflicts between
the changes in your org and the changes in your local project, the command will not finish and
will show the conflicts.

Examples:

1. force:source:beta:pull

7. Force:source:push: The "force:source:push" command in Salesforce CLI is used to deploy


changes from your local project to your Salesforce org. If any conflicts arise during the
deployment process, the command will abort the process and display the conflicts.

Examples:

1. force:source:beta:push

You might also like