1

Today I have been struggling trying to migrate reports and dashboards from developer organization to production. Looks like we can't deploy dashboard without a folder. While for reports there exist standard 'Unfilled Public' folder, for Dashboard there is no predefined public folder. When I tried to deploy the dashboard I kept receiving error

Public_Dashboards/Jobs_Executed_and_Booked_For_This_Week Dashboard 0 0 Cannot find folder:Public_Dashboards

even when I tried to add folder to package.xml like this

<types>
    <members>Public_Dashboards</members>
    <name>Folder</name>
</types>

I still kept receiving the same error with additional messages like

Public_Dashboards/Jobs_Executed_and_Booked_For_This_Week Dashboard 0 0 Cannot find folder:Public_Dashboards 0 0 Unknown type name 'Folder' specified in package.xml

When I tried to specify DashboardFolder type in package.xml

<types>
    <members>Public_Dashboards</members>
    <name>DashboardFolder</name>
</types>

I still had the same error with a different message

0 0 Unknown type name 'DashboardFolder' specified in package.xml Public_Dashboards/Jobs_Executed_and_Booked_For_This_Week Dashboard 0 0 Cannot find folder:Public_Dashboards

How to deploy or retrieve dashboard folder?

3 Answers 3

4

Today I have found an answer in docs here: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_folder.htm

First of all, to migrate dashboards and folder you have to create public dashboard, then you can retrieve or deploy in the same way.

The documentation gives example for Document folder

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>basic</fullName>
    <types>
        <members>sampleFolder</members>
        <members>sampleFolder/TestDocument.txt</members>
        <name>Document</name>
    </types>
    <version>37.0</version>
</Package>

but this works in the same way for Dashboard folder

<types>
    <members>Public_Dashboards</members>
    <members>Public_Dashboards/Jobs_Executed_and_Booked_For_This_Week</members>
    <name>Dashboard</name>
</types>
0

This is because the dashboard folder is not present on the target. When you use the following while retrieving :

<types>
    <members>Public_Dashboards</members>
    <members>Public_Dashboards/Jobs_Executed_and_Booked_For_This_WeekDashboard</members>
    <name>Dashboard</name>
 </types>

It will create a dashboard folder with the same name and folder sharing with correct access levels as on the source org.

0

You can retrive the folder metadata if you use this code.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>basic</fullName>
    <types>
        <members>uniqueFolderName</members>
        <name>Report</name>
    </types>
    <version>37.0</version>
</Package>

You must log in to answer this question.

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