3

Using Visual Studio Code and Salesforce CLI I am trying to retrieve a "Custom Object" details. But I was not able to fetch it. I am getting the below error.

Error: sfdx force:source:retrieve --manifest c:\Sandbox Org Name\manifest\package.xml ended with exit code 134

But I am able to retrieve other custom objects from the Same org. Any particular reason? Did anyone face similar issues? This is happening in the sandbox. Please help

Package.xml used:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Custom Object API Name</members>
        <members>*</members>
        <name>CustomObject</name>
    </types>
    <version>47.0</version>
</Package>
  • Can you please clarify the sentence:- But I am able to retrieve other custom objects from the Same org. – sanket kumar Nov 26 '19 at 15:14
  • I am able to retrieve a few custom objects. There are a few custom Objects which I am not able to retrieve. I need one very important custom object which I need it, but I am not able to retrieve it. – Saravana Bhupesh Nov 27 '19 at 12:16
3

The easiest way I’ve found to do this is:

sfdx force:source:retrieve -m CustomObject

If you need it, include the -u option with your target username. This command pulls down all metadata of the type CustomObject. If you want one specific object, add a colon and then the object’s API name:

sfdx force:source:retrieve -m CustomObject:Account

Or

sfdx force:source:retrieve -m CustomObject:Sample__c
| improve this answer | |
  • Hi Allison, Thanks for responding. Can you please let me know where should I mention this command? I tried after clicking CTRL + Shift + P but I am not able to use this command. – Saravana Bhupesh Nov 27 '19 at 13:43
  • @SaravanaBhupesh run it in a new VSCode terminal in the project. – Allison Letts Nov 27 '19 at 13:45
1

Wildcard doesn't work with object in visual studio code for some reason you have to list out each object you want to retrieve in the package.xml file.

Here is an example:

 <types>
    <members>Account</members>
    <members>Campaign</members>
    <members>Case</members>
    <name>CustomObject</name>
</types>
| improve this answer | |
  • This is a misdiagnosis. The wildcard doesn't work with standard objects, like the ones listed here – David Reed Nov 27 '19 at 4:38
  • Hi Zach Thanks for responding. Even if I remove the wild card I am not able to do retrieve the custom object. – Saravana Bhupesh Nov 27 '19 at 13:40
0

Salesforce provides sample manifest files for how to retrieve data for both custom and standard objects that you can reference here. https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/manifest_samples.htm

| improve this answer | |

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.