2

We created a custom Lightning Theme (Setup > User Interface > Themes and Branding) in the sandbox and have to push it to another org using Metadata API.

We were able to retrieve Branding Set from Source Org by specifying below in package xml, however, when we deploy the same to Target org (Specified in package xml & Branding Set folder is available in src), it doesn't show up in the Target org.

<types>
    <members>LEXTHEMINGMy_Theme</members>
    <name>BrandingSet</name>
</types>

Do you know the right way of deploying Themes & Branding using metadata API?

Based on the Answer below, I used following package XML to retreive all the components related to my Lightning theme

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ThemeName</members>
        <name>BrandingSet</name>
    </types>
    <types>
        <members>ImageName</members>
        <members>BG_ImageName</members>
        <name>ContentAsset</name>
    </types>
    <types>
        <members>ThemeName</members>
        <name>LightningExperienceTheme</name>
    </types>
    <version>43.0</version>
</Package>

3 Answers 3

6

Add this to your package and this will work:

<types>
    <members>YourThemeHere!!!</members>
    <name>LightningExperienceTheme</name>
</types>

If you don't know what your theme name is, you can reference it by checking what's in the masterLabel tab within your brandingSet xml file.

I had the same problem and found the solution by searching the metadata within the workbench. https://workbench.developerforce.com/login.php

1
  • If you're using VSCode with the SFDX extensions, another VSCode extension that helps a ton in finding the actual names you need is the "Salesforce Package.xml Generator Extension for VS Code" extension. I couldn't live without it!
    – Whitzz
    Commented Apr 4, 2022 at 15:52
1

According to Salesforce docs you need two declarations inside package.xml:

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_lightningexperiencetheme.htm

In your package.xml you should have:

<types>
    <members>LEXTHEMINGThemeName</members>
    <name>BrandingSet</name>
</types>
<types>
    <members>Summer Celebration</members>
    <name>LightningExperienceTheme</name>
</types>

Finally, don't forget to setup YourTheme.lightningExperienceTheme file inside the lightningExperienceThemes folder.

0

If you are not sure of what the name of the theme is, you can put this in your package.xml file

<types>
    <members>*</members>
    <name>LightningExperienceTheme</name>
</types>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .