I set up and ran destructiveChanges.xml through the ANT tool to delete custom fields from the Activity object in the sandbox.
I am getting an error -
Error: Not in package.xml
build file:
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">
<!--<property file="build.properties"/>-->
<property environment="env"/>
<property name="my.pkgName" value="Activity Custom Fields" />
<!-- Setting default value for username, password and session id properties to empty string
so unset values are treated as empty. Without this, ant expressions such as ${sf.username}
will be treated literally.
-->
<condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not> </condition>
<condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not> </condition>
<condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not> </condition>
<taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
<classpath>
<pathelement location="ant-salesforce.jar"/>
</classpath>
</taskdef>
<target name="retrievePkg">
<mkdir dir="${my.pkgName}"/>
<sf:retrieve username="my username" password="pw and security token" sessionId="${sf.sessionId}" serverurl="https://test.salesforce.com" maxPoll="200" retrieveTarget="${my.pkgName}" packageNames="${my.pkgName}" />
</target>
<!-- Shows deploying code & running tests for code in directory -->
<target name="deployScript">
<sf:deploy
checkOnly="false"
username="my username"
password="pw and security token"
serverurl="https://test.salesforce.com"
maxPoll="10000"
pollWaitMillis="1000"
deployRoot="C:\\Salesforce\\Activity Custom Fields"
testLevel="NoTestRun"
ignoreWarnings="true">
</sf:deploy>
</target>
</project>
destructiveChanges.xml:
<?xml version="1.0" encoding="UTF-8"?>
-<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Activity Custom Fields</fullName>
<description>Custom fields on the activity object for deletion.</description>
-<types>
<members>Activity.Alert_Users__c</members>
<members>Activity.Attendance__c</members>
<members>Activity.CCR_Data__c</members>
<members>Activity.CCR_Functionality__c</members>
<members>Activity.CCR_Messaging__c</members>
<members>Activity.CCR_Resource_Allocation__c</members>
<members>Activity.CCR_Training__c</members>
<members>Activity.Campaign_Design_Profile_Name__c</members>
<members>Activity.Campaign_Event__c</members>
<members>Activity.Client_Request_Goal__c</members>
<members>Activity.Company_List__c</members>
<members>Activity.Company_Suppression_List__c</members>
<members>Activity.Contact_Information__c</members>
<members>Activity.Contact_List__c</members>
<members>Activity.Contact_Suppression_List__c</members>
<members>Activity.DC_Agent__c</members>
<members>Activity.D_B_PO_Number__c</members>
<members>Activity.Data_Team_Comments__c</members>
<members>Activity.Date_Delivered__c</members>
<members>Activity.Date_Sent_to_Partner__c</members>
<members>Activity.Deadline_Not_Met_Reason__c</members>
<members>Activity.Delivery_Channel__c</members>
<members>Activity.ETA_Back_to_Sales__c</members>
<members>Activity.Employee_Count__c</members>
<members>Activity.Industry__c</members>
<members>Activity.Install_Base__c</members>
<members>Activity.Key_Resources__c</members>
<members>Activity.Location_Type__c</members>
<members>Activity.Master_CDP_Number__c</members>
<members>Activity.New_ETA__c</members>
<members>Activity.No_Owner_Match__c</members>
<members>Activity.Notes__c</members>
<members>Activity.PO_Number__c</members>
<members>Activity.Partner_Contacts__c</members>
<members>Activity.Partner_Orgs__c</members>
<members>Activity.Partner__c</members>
<members>Activity.Product_Name__c</members>
<members>Activity.Production_Contacts__c</members>
<members>Activity.Production_Org__c</members>
<members>Activity.Reachforce_PO_number__c</members>
<members>Activity.Reason_Due_Date_Not_Met__c</members>
<members>Activity.Region__c</members>
<members>Activity.Reopen_Reason__c</members>
<members>Activity.Request_Status__c</members>
<members>Activity.Request_Type__c</members>
<members>Activity.Revised_Due_Date__c</members>
<members>Activity.Sales_Comments__c</members>
<members>Activity.Sales_Revenue__c</members>
<members>Activity.Social_123_PO_Number__c</members>
<members>Activity.Source_ID__c</members>
<members>Activity.Status_Notes__c</members>
<members>Activity.Target_Department__c</members>
<members>Activity.Target_Level__c</members>
<members>Activity.Type_of_Visit__c</members>
<members>Activity.Visit_Date_s__c</members>
<members>Activity.Zip_Code__c</members>
<members>Activity.Zip_Radius__c</members>
<name>CustomField</name>
</types>
<version>43.0</version>
</Package>
package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>43.0</version>
</Package>
destructiveChanges.xml
andpackage.xml
used for this job?package.xml
in your destructive run should be empty.... (other than the version tag)sfdx force:source:delete
?