2

I'm trying to deploy a list view for a custom metadata type using the Force.com Migration Tool, but I am unable to locate the ListView to include in my package.xml retrieve. I have deployed many ListViews for custom objects, but ListViews for custom metadata types aren't showing up in the "metadata explorer" interface I use (Workbench).

How do I reference the custom metadata type's ListView in my package.xml?

What I've tried:

<types>
    <members>Conference_RSVP_Config__mdt.All_Conferences</members>
    <name>ListView</name>
</types>

The result:

Entity of type 'ListView' named 'Conference_RSVP_Config__mdt.All_Conferences' cannot
 be found
  • whats your API version ? – Pranay Jaiswal May 14 '18 at 19:48
  • 40.0 for my package.xml. 41.0 for the Workbench, where I can't find the ListView – Brent Bow May 14 '18 at 19:54
5

List view fetching for custom metadata types are bit tricky.

If you retrieve a List View on a Custom Setting/Custom Metdata along with the Custom Setting/Metadata object when using Metadata API in a single transaction, the List View information is not retrieved.

You have to retrieve both separately.

Suppose:

MetaData Object Name: MyObject__mdt

ListView Unique Name: My_View

Then your listview package.xml will be

<?xml version="1.0" encoding="UTF-8"?> 
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> 
<types> 
<members>MyObject__mdt.My_View</members> 
<name>ListView</name> 
</types> 
<version>39.0</version> 
</Package> 

It will retrieve Object file for you containing the Listview

Known Issue Link : https://success.salesforce.com/issues_view?id=a1p3A0000018BCTQA2

  • 1
    Thanks for this, @Pranay Jaiswal. The Known Issue you linked to solves my problem. However, would you please update your response to emphasize the key here, which is that if you retrieve a List View on a Custom MDT along with the Custom MDT object when using Metadata API in a single transaction, the List View information is not retrieved. I had to remove the retrieve of the CustomObject iin order to get the list views to show up, until the Summer '18 release which apparently resolves the issue. – Brent Bow May 14 '18 at 20:13
  • If you can update your comment to emphasize that difference for others, I'll mark your answer as solved. Thanks! – Brent Bow May 14 '18 at 20:14
  • 1
    That was my first line , somehow got ommited :/ Edited finally. – Pranay Jaiswal May 14 '18 at 20:16
  • You can still retrieve CustomObjects by using the build.xml and specifying a second package file and 2 sf:retrieve commands inside one target node. <sf:retrieve username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="test" unpackaged="test/package0.xml"/> <sf:retrieve username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="test" unpackaged="test/package.xml"/> - – Ogier Schelvis Jul 24 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.