3

I have a custom object. In the new scratch org I changed a custom button URL of the object using Salesforce UI. Then I run sfdx force:source:pull and retrieved 2 changed files: the changed weblink and the object's xml. Weblink file is fine but the object xml file is broken as it's content vanished.

My <ObjectApiName>.object-meta.xml before the pull:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides>
        <actionName>Accept</actionName>
        <type>Default</type>
    </actionOverrides>
    ...
    ...
    <sharingModel>ReadWrite</sharingModel>
    <visibility>Public</visibility>
</CustomObject>

after:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <enableEnhancedLookup>true</enableEnhancedLookup>
</CustomObject>

Why it happened and how to make it preserve the object's xml?

  • 1
    This could be a issue with the source:pull command if you can replicate it consistently. For instance, there's some open issues about using source:pull after creating new objects and pulling the dependent metadata changes on profiles and layouts. I'd have to test on my end if the same occurs for your given scenario – Kris Goncalves Mar 12 at 12:48
1

As far with the tests I made the org just pulls the changes you did or the metadatas you explicity put in the package.

If you want to get everything whithin the Object you should get all CustomFields, all Actions, etc. and the Object you want, for example.

<types>
    <members>*</members>
    <name>CustomField</name>
</types>
<types>
    <members>MyCustomObject__c</members>
    <name>CustomObject</name>
</types>
| improve this answer | |
  • Hello @Luis, is it a package.xml file? How can I use it with the force:source:pull command? – Mikhail Ivanov Mar 12 at 11:15
  • 2
    @MikhailIvanov I use the following command sfdx force:source:retrieve --manifest C:\FolderName\myManifest.xml – Luis G. Lino Mar 12 at 13:22

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.