cli
cli copied to clipboard
sf project retrieve start --metadata 'CustomField:<namespace>__*' doesn't retrieve customfields from standard objects
Expected result
Custom fields with the specified namespace to be retrieved. Relevant standard object and field directories to be created under the objects folder if they don't exist yet.
E.g: "project/main/default/objects/Account/fields/mycustomfield__nsp__c.field-meta.xml"
Actual result
"Preparing retrieve request... done Nothing retrieved"
Additional information
When I try to retrieve the customfields created on standard objects by a managed package, the command
sf project retrieve start --metadata 'CustomField:<namespace>__*'
returns
Nothing retrieved
It forces me to adjust the command to specify the standard object names in this way:
sf project retrieve start --metadata 'CustomField:<standardObjectName>.<namespace>__*'
E.g:
sf project retrieve start --metadata 'CustomField:Account.c2g__*'
That solution is not aligned with the general behaviour of the --metadata flag. The documentation doesn't mention it neither.
Since I'm building a process to retrieve those custom fields (among other metadata) from different org types, with different versions of the packages, I can't really know in advance all the standard objects with custom fields created by the managed package on them.
Running the retrieve command with all the possible standard objects names in the org is possible and works well according to our tests, but it takes around 10 minutes and is an unnecessary overload.
System Information
CLI:
@salesforce/cli/2.61.8 darwin-arm64 node-v21.6.2
Plugin Version:
@oclif/plugin-autocomplete 3.2.5 (core)
@oclif/plugin-commands 4.0.16 (core)
@oclif/plugin-help 6.2.13 (core)
@oclif/plugin-not-found 3.2.22 (core)
@oclif/plugin-plugins 5.4.10 (core)
@oclif/plugin-search 1.2.10 (core)
@oclif/plugin-update 4.5.10 (core)
@oclif/plugin-version 2.2.14 (core)
@oclif/plugin-warn-if-update-available 3.1.18 (core)
@oclif/plugin-which 3.2.15 (core)
@salesforce/cli 2.61.8 (core)
apex 3.5.0 (core)
api 1.2.2 (core)
auth 3.6.65 (core)
data 3.6.8 (core)
deploy-retrieve 3.12.15 (core)
info 3.4.9 (core)
limits 3.3.32 (core)
marketplace 1.2.26 (core)
org 4.6.0 (core)
packaging 2.8.10 (core)
schema 3.3.34 (core)
settings 2.3.23 (core)
sobject 1.4.40 (core)
source 3.5.21 (core)
telemetry 3.6.15 (core)
templates 56.3.21 (core)
trust 3.7.32 (core)
user 3.5.32 (core)
SF ENV. VARS.
SF_AUTOUPDATE_DISABLE,true
SF_DISABLE_AUTOUPDATE,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: false
Shell: zsh
Channel: stable
Diagnostics
:white_check_mark: pass - salesforcedx plugin isn’t installed :white_check_mark: pass - you don't have any linked plugins :white_check_mark: pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion :white_check_mark: pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org :white_check_mark: pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com :white_check_mark: pass - [@salesforce/plugin-trust] can ping: https://artifactory.dev.financialforce.com/artifactory/api/npm/ffdc-npm :white_check_mark: pass - using latest or latest-rc CLI version :white_check_mark: pass - can access: https://test.salesforce.com :white_check_mark: pass - can access: https://appexchange.salesforce.com/services/data :x: fail - [@salesforce/plugin-auth] CLI supports v2 crypto :white_check_mark: pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest