Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot retrieve namespaced objects via wildcard #2875

Closed
jclark-dot-org opened this issue May 20, 2024 · 5 comments
Closed

Cannot retrieve namespaced objects via wildcard #2875

jclark-dot-org opened this issue May 20, 2024 · 5 comments
Labels
documentation Issue or pull request to update or fix documentation investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@jclark-dot-org
Copy link

Summary

I need to retrieve Profiles with object settings (CRUD) for a number of namespaced (managed) managed objects. The docs for project retrieve start state, Wildcards ('*') supported as long as you use quotes, such as 'ApexClass:MyClass*', however, every attempt to fetch these objects using wildcard fails.

Steps To Reproduce

This can be tested in any org with a managed packed installed; I am specifically trying work with Salesforce CPQ (namespace SBQQ).

(A) Try to retrieve profiles with all object settings:

sf project retrieve start --metadata 'CustomObject:*' --metadata 'Profile:*'

(B) Try to specify the namespace:

sf project retrieve start --metadata 'CustomObject:SBQQ.*' --metadata 'Profile:*'

Expected result

Metadata for all Objects (including Namespaced objects) are retrieved, and Profiles are retrieved with Object permissions.

Actual result

Only local namespace objects are retrieved.

In the case of Repro (B), a message is shown after the local objects are fetched:

=====================================================================================
| File                   Problem
| ───────────────────────────────────────────────────────────────────────────────────
| unpackaged/package.xml Entity of type 'CustomObject' named 'SBQQ.*' cannot be found

System Information

SHELL: zsh (oh my zsh) on Mac OS Sonoma

SF CLI Version Info:

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.41.8",
  "nodeVersion": "node-v21.4.0",
  "osVersion": "Darwin 23.3.0",
  "rootPath": "/Users/jclark/.nvm/versions/node/v21.4.0/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.17 (core)",
    "@oclif/plugin-commands 3.3.2 (core)",
    "@oclif/plugin-help 6.0.21 (core)",
    "@oclif/plugin-not-found 3.1.8 (core)",
    "@oclif/plugin-plugins 5.0.19 (core)",
    "@oclif/plugin-search 1.0.23 (core)",
    "@oclif/plugin-update 4.2.11 (core)",
    "@oclif/plugin-version 2.0.18 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.16 (core)",
    "@oclif/plugin-which 3.1.9 (core)",
    "@salesforce/cli 2.41.8 (core)",
    "apex 3.1.11 (core)",
    "auth 3.6.9 (core)",
    "data 3.3.4 (core)",
    "deploy-retrieve 3.6.13 (core)",
    "info 3.2.7 (core)",
    "limits 3.3.5 (core)",
    "marketplace 1.2.5 (core)",
    "org 4.1.8 (core)",
    "packaging 2.4.2 (core)",
    "schema 3.3.6 (core)",
    "settings 2.2.6 (core)",
    "sobject 1.4.1 (core)",
    "source 3.3.9 (core)",
    "telemetry 3.3.5 (core)",
    "templates 56.2.5 (core)",
    "trust 3.6.8 (core)",
    "user 3.5.5 (core)"
  ]
}
@jclark-dot-org jclark-dot-org added the investigating We're actively investigating this issue label May 20, 2024
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@github-actions github-actions bot added the validated Version information for this issue has been validated label May 20, 2024
@iowillhoit
Copy link
Contributor

Hey @jclark-dot-org, can you try using __ instead of . in your retrieve? For example:

sf project retrieve start --metadata 'CustomObject:SBQQ__*'

If you run sf org list metadata --metadata-type CustomObject on an org that contains some namespaced objects, you'll see the __ used to in the fullName

@jclark-dot-org
Copy link
Author

@iowillhoit Thanks, I can confirm that works. I've also confirmed that --metadata 'CustomObject:*__*' --metadata 'CustomObject:*' gets all Standard and Custom Objects in all namespaces, which is a little odd, but it works. If would be great if these details could be added to the Docs, on the reference page for project retrieve as well.

@iowillhoit iowillhoit added documentation Issue or pull request to update or fix documentation bug Issue or pull request that identifies or fixes a bug labels May 20, 2024
Copy link

git2gus bot commented May 20, 2024

This issue has been linked to a new work item: W-15810307

@iowillhoit
Copy link
Contributor

Thanks @jclark-dot-org, I opened a ticket to mention this in the project deploy and project retrieve docs.

@VivekMChawla VivekMChawla removed the bug Issue or pull request that identifies or fixes a bug label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue or pull request to update or fix documentation investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants