[SalesForce] Retrieve Report/Dashboard standard tab visibility level for Profile via Metadata API

To retrieve tab visibility level for specific profile the following content of package.xml works:

<types>
    <members>TransferRequest__c</members>
    <name>CustomTab</name>
</types>

<types>
    <members>SomeProfile</members>
    <name>Profile</name>
</types>

and as a result of this action SomeProfile.profile will contain:

<tabVisibilities>
    <tab>TransferRequest__c</tab>
    <visibility>Hidden</visibility>
</tabVisibilities>

How can I do the same for standard Reports and Dashboards tabs?

Best Answer

You need to retrieve the Report tab and the Profile. Here is a sample package.xml that I used:

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
    <members>*</members>
    <members>standard-Report</members>
    <name>CustomTab</name>
</types>
<types>
    <members>Custom: Standard User</members>
    <name>Profile</name>
</types>
<version>40.0</version>

Good luck.

Sridhar