Retrieve ChatterExtension

How to retrieve ChatterExtension using package.xml or manifest

Syntax to fetch ChatterExtension metadata

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

What is ChatterExtension in Salesforce?

A ChatterExtension is the metadata behind a Rich Publisher App, which adds a custom item to the Chatter publisher. Retrieving it lets you keep that configuration in source control or move it to another org.

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/chatterExtensions to see the retrieved files.

The * in the example retrieves every Chatter extension in the org. To retrieve only one, replace the star with its API name.

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 ChatterExtension

Where the files are saved

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

Common problems and fixes

  • Entity of type ChatterExtension 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

Can I retrieve one extension instead of all of them?
Yes. Replace the * in the members tag with the API name of the extension.

Which API version should I use?
The examples use 62.0, but you can use the current API version of your org. A higher version is fine as long as your org supports it.

Leave a Reply