Retrieve App Using package.xml

How to retrieve App/Custom Application With package.xml

Syntax to retrieve app with package.xml

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <name>CustomApplication</name>
        <members>Application_DeveloperName</members>
    </types>
    <version>62.0</version>
</Package>

Explanation:

In Salesforce we we two types of applications
  1. Custom Apps
  2. Standard Apps
Both types app application are supported in Salesforce Classic & Lighting Environment. If we created app for salesforce lightning view then we can cannot leverage that classic view. For Lighting Apps you can created a Utility Bar, Find how to retrieve Utility Bar of an Salesforce Lighting App.

What is CustomApplication in Salesforce?

A CustomApplication is the metadata for a Lightning or Classic app. Retrieving it gives you the app definition, including its navigation items and branding, in a single file.

Steps to retrieve it in VS Code

  1. Open your Salesforce DX project in VS Code and authorize your org with SFDX: Authorize an Org.
  2. Open manifest/package.xml, or create the file, and paste the XML shown above.
  3. Right-click package.xml and choose SFDX: Retrieve Source in Manifest from Org.
  4. When the command finishes, open the folder force-app/main/default/applications to see the retrieved files.

The member is the developer (API) name of the app. You can find it in Setup under App Manager. Apps from a managed package carry the package namespace as a prefix.

Retrieve it with the Salesforce CLI

If you prefer the terminal, run one of these commands from your project folder:

sf project retrieve start --manifest manifest/package.xml
sf project retrieve start --metadata CustomApplication:Application_DeveloperName

Where the files are saved

After a successful retrieve, the files are placed inside your project, for example in force-app/main/default/applications/YourApp.app-meta.xml.

Common problems and fixes

  • Entity of type CustomApplication cannot be found: check the spelling and the API name of the member, and make sure you are authorized to the correct org.
  • Nothing was retrieved: run sf org list to confirm the default org, and check that the component actually exists there.
  • API version: the examples use version 62.0. You can use a higher version if your org supports it.

FAQ

Where do I find the app developer name?
Open Setup, search for App Manager, and look at the Developer Name column for your app.

Does this include the Utility Bar?
No. The Utility Bar is stored separately as a FlexiPage, so retrieve it with its own entry.

Leave a Reply