SalesforceDX CLI “sObject type ‘SourceMember’ is not supported” with source pull

I’m trying to pull down the current source for a sandbox org I’ve just connected to. General steps were:

  1. Connect to the org.
    sfdx force:auth:web:login -r https://test.salesforce.com -a someOrg
  2. Create the project
    sfdx force:project:create -n thatSandbox
  3. Switch into new project directory
  4. Attempt to pull down the current org source
    sfdx force:source:pull -u someOrg

On the last step it fails with:

ERROR running force:source:pull:
MemberName, IsNameObsolete FROM SourceMember WHERE RevisionNum >
^
ERROR at Row:1:Column:52
sObject type ‘SourceMember’ is not supported. If you are attempting to use a
custom object, be sure to append the ‘__c’ after the entity name. Please reference your WSDL or the describe call for the appropriate names.

The sandbox is CS17, which is currently on Winter ’18 Patch 4.4 (210.4.4).

Can I only do a source pull from a Scratch Org? If so, I guess I’d need to do a metadata retrieve from the sandbox and then convert to the Salesforce DX project format.

For what it’s worth, SourceMember (0MZ keyprefix) was added in beta in the Summer ’17 release to the Tooling API:

Represents a single sObject of all source that you are tracking in a scratch org

Answer

You are correct that you can only do a source pull from a Scratch Org. You can retrieve the source from a managed or unmanaged package. Just put everything you want to retrieve into an unmanaged package and then follow these steps

Attribution
Source : Link , Question Author : Daniel Ballinger , Answer Author : Zack Walton

Leave a Comment