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
PaladyrPaladyr 

Trying to deploy a custom object using force.com migration tool

I'm getting the error:

 

Error: package.xml(purchase__c): An object 'purchase__c' of type CustomObject was named in package.xml, but was not found in zipped directory.  In the deployTest directory, I have the package.xml file below and an objects folder.  Inside the objects folder, I have a file Purchase__c.object which was retrieved from the org I'm copying metadata from.  What am I missing?  Also, do I have to name all the custom fields?  I thought I could just deploy the custom object but when I tried that it gave me errors saying that the package.xml file didn't contain all the custom fields.  Thanks.

 

package.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>purchase__c</members>
        <name>CustomObject</name>
    </types>
  <types>
    <members>Purchase__c.Admin_Fee__c</members>
    <members>Purchase__c.Affiliated__c</members>
    <members>Purchase__c.Amount__c</members>
    <members>Purchase__c.Comments__c</members>
    <members>Purchase__c.Fee__c</members>
    <members>Purchase__c.Fiscal_Year__c</members>
    <members>Purchase__c.Member__c</members>
    <members>Purchase__c.Other_Fee__c</members>
    <members>Purchase__c.PurchaseID__c</members>
    <members>Purchase__c.Report_Date__c</members>
    <members>Purchase__c.Report_Total__c</members>
    <members>Purchase__c.Type__c</members>
    <members>Purchase__c.VendorType__c</members>
    <members>Purchase__c.Vendor__c</members>
    <members>Purchase__c.Write_Off__c</members>
    <name>CustomField</name>
  </types>
    <version>22.0</version>
</Package>

 build.xml:

 

<project name="Sample usage of Salesforce Ant tasks" default="purchase" basedir="." xmlns:sf="antlib:com.salesforce">

    <property file="build.properties"/>
    <property environment="env"/>

  <target name="purchase">
    <!-- Upload the contents of the "mypkg" package -->
    <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployRoot="deployTest"/>
  </target>
</project>

 

 

PaladyrPaladyr

I tried it with a different custom object and the deploy works, so there must be something specifically about this object that is causing it to fail, and the message doesn't appear to be of any help.  Any ideas what could be in this table causing this error?

PaladyrPaladyr

It just worked.  Maybe a field in this table was dependent on another field in the account table... maybe???  I don't know.  Thanks anyway!

ASHOK RAJ R 18ASHOK RAJ R 18
I had faced same issue. I have added Meta.XML file manually and re - deployed. It got fixed.

Sample
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="modalLwc">
    <apiVersion>45.0</apiVersion>
    <isExposed>true</isExposed>
    <!-- With following targets make component available for lightning app page, record page and home page in salesforce --><targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>