4

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>
4
  • Can you please clarify the sentence:- But I am able to retrieve other custom objects from the Same org. Nov 26, 2019 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. Nov 27, 2019 at 12:16
  • I'm not super sure if this will help but VSCode has "sfdx sobject definitions refresh" (ctrl+shift+p and then scroll to SFDX section) where you can sync with your Salesforce Org and pull in any new custom fields/objects.
    – Lifespark
    Jun 11, 2021 at 16:37
  • @Lifespark Welcome to SFSE - I converted your post to a comment because it's not really a full answer to the question, and as a new user you couldn't comment. Please do stick around and soon you'll be able to :)
    – Matt Lacey
    Jun 15, 2021 at 0:30

3 Answers 3

9

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
2
  • 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. Nov 27, 2019 at 13:43
  • @SaravanaBhupesh run it in a new VSCode terminal in the project. Nov 27, 2019 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>
2
  • 1
    This is a misdiagnosis. The wildcard doesn't work with standard objects, like the ones listed here
    – David Reed
    Nov 27, 2019 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. Nov 27, 2019 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .