function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JohnnyV!JohnnyV! 

Deleting List Views <listViews> using Force Migration Tool ...

I've been looking at the destructivechanges.xml file section of the Force Migration Tool and was wondering if anyone has been able to remove list views (views within Leads, Accounts, etc) but not removing the core object (Lead, Account, etc).

In our example, we want to clean up some of the default views within the Leads and Accounts tabs.   What I cannot figure out is how to specify only those items, since the package.xml doesn't really go deeper than listing the Lead and Account object (as shown below):

    <types>
        <members>Account</members>
        <members>Lead</members>
        <name>CustomObject</name>
    </types>

I would guess that putting the information in the destructivechanges.xml would remove the Account and Lead objects ... or at least attempt to. :) Instead, I would prefer to remove <listViews> items from the Account.object and Lead.object files.  Example below:

    <listViews>
        <fullName>AccountsInMyMarket</fullName>
        <booleanFilter>1</booleanFilter>
        <columns>ACCOUNT.NAME</columns>
        <columns>ACCOUNT.ADDRESS1_STATE</columns>
        <columns>ACCOUNT.PHONE1</columns>
        <columns>ACCOUNT.TYPE</columns>
        <columns>CORE.USERS.ALIAS</columns>
        <filterScope>Everything</filterScope>
        <filters>
            <field>Is_My_Market__c</field>
            <operation>equals</operation>
            <value>1</value>
        </filters>
        <label>Accounts In My Market</label>
    </listViews>

I would like to remove the Accounts In My Market item as shown above.

Any idea how to do that using the Force Migration Tool and destructivechanges.xml?

Thanks so much for your time!
jv
 
ShashankShashank (Salesforce Developers) 
Please see if this helps: http://salesforce.stackexchange.com/questions/22774/how-to-delete-list-view-from-metadata
pankaj singla 39pankaj singla 39
Use the following destructive xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
	<types>
	<name>ListView</name>
	<members>Account.AccountsInMyMarket.</members>
	</types>
<version>41.0</version>	
</Package>