0

I am trying to deploy a xml file but i get the following error:

4.  objects/Account.object (Account.NbOppsOuvertesAvancees__c) -- Error: Invalid Field: Opportunity.RecordTypeId (line 1607, column 29)
5.  objects/Account.object (Account.NbOppsOuvertesBP__c) -- Error: Invalid Field: Opportunity.RecordTypeId (line 1628, column 29)
6.  objects/Account.object (Account.NbOppsOuvertesCE__c) -- Error: Invalid Field: Opportunity.RecordTypeId (line 1654, column 29)
7.  objects/Account.object (Account.NbOppsOuvertesCOAP__c) -- Error: Invalid Field: Opportunity.RecordTypeId (line 1681, column 29)
8.  objects/Account.object (Account.NbOppsOuvertesNX__c) -- Error: Invalid Field: Opportunity.RecordTypeId (line 1712, column 29)

here is my xml file used to deploy the package:

<types>
          <members>*</members>
          <name>CustomField</name>
      </types>
  <types>
        <members>*</members>
         <name>ApexClass</name>
     </types>
  <types>
          <members>*</members>
          <name>ApexPage</name>
      </types>
  <types>
          <members>*</members>
          <name>RecordType</name>
      </types>

  <types>
          <members>*</members>
          <name>FlexiPage</name>
      </types>
  <types>
      <members>*</members>
      <name>CustomLabels</name>
  </types>
  <types>
          <members>*</members>
          <name>GlobalPicklist</name>
      </types>
      <types>
              <members>*</members>
              <name>GlobalPicklist</name>
          </types>
  <types>
      <members>Account</members>
      <members>AccountContactRole</members>
      <members>Activity</members>
      <members>Asset</members>
      <members>Campaign</members>
      <members>CampaignMember</members>
      <members>CaseContactRole</members>
      <members>Contact</members>
      <members>ContentVersion</members>
      <members>Contract</members>
      <members>ContractContactRole</members>
      <members>Event</members>
      <members>Idea</members>
      <members>Lead</members>
      <members>Opportunity</members>
      <members>OpportunityContactRole</members>
      <members>OpportunityLineItem</members>
      <members>PartnerRole</members>
      <members>Product2</members>
      <members>Site</members>
      <members>Solution</members>
      <members>Task</members>
      <members>User</members>
      <members>UserLicense</members>
      <members>*</members>
      <name>CustomObject</name>
  </types>

what i am doing wrong ?

0

The package.xml file is perfectly fine, but your objects/Opportunity.object file is missing some data. Namely, there should be at least one RecordType entry in file, as follows:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
. . .
   <recordTypes>
        <fullName>My First Recordtype</fullName>
    </recordTypes>
 . . .
</CustomObject>

If you don't have at least one Record Type in the system for an object, you'll get this error if there's other references to the RecordTypeId field.

| improve this answer | |
  • i looked to opportunity file and there is already a recordType there – Merabti Ibrahim Dec 22 '16 at 14:47
  • <recordTypes> <fullName>Opportunite</fullName> <active>true</active> <businessProcess>Oppportunité</businessProcess> <compactLayoutAssignment>PresentationCompacteDOpportunite</compactLayoutAssignment> <description>Opportunité de Vente</description> – Merabti Ibrahim Dec 22 '16 at 14:47
  • @MerabtiIbrahim In that case, it shouldn't ordinarily fail. Are you getting additional errors about Opportunity failing to deploy (e.g. some problem with the Opportunity object itself)? If not, then you may very well have encountered a bug, and you'll need to provide a dummy record type before deploying this package, or make two deployments, one with Opportunity, and then again with everything else. – sfdcfox Dec 22 '16 at 14:49
  • yes, indeed, i got another error just before the errors i posted here, [sf:deploy] 3. objects/Opportunity.object (Opportunity.Opportunite) -- Error: In field: businessProcess - no BusinessProcess named Opportunity.OppportunitÚ found (line 2063, column 18) – Merabti Ibrahim Dec 22 '16 at 14:58
  • That this explain this errors – Merabti Ibrahim Dec 22 '16 at 15:06

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.