sf project retrieve start --metadata 'CustomField:<namespace>__*' doesn't retrieve customfields from standard objects
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- cli
调研方向
首先复现 sf project retrieve start --metadata 'CustomField:<namespace>__*',并将其与显式形式 CustomField:<standardObjectName>.<namespace>__* 进行比较。阅读 @salesforce/plugin-deploy-retrieve 对 --metadata retrieve 选择器和标准对象字段输出的处理。完成标准是:仅使用 namespace 进行选择时,能够检索匹配的自定义字段,并创建预期的对象目录和字段目录。
由索引模型根据 Issue 内容生成。
描述
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
✅ pass - salesforcedx plugin isn’t installed
✅ pass - you don't have any linked plugins
✅ pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
✅ pass - [@salesforce/plugin-trust] can ping: https://artifactory.dev.financialforce.com/artifactory/api/npm/ffdc-npm
✅ pass - using latest or latest-rc CLI version
✅ pass - can access: https://test.salesforce.com
✅ pass - can access: https://appexchange.salesforce.com/services/data
❌ fail - [@salesforce/plugin-auth] CLI supports v2 crypto
✅ pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
- 主要语言
- 没有语言数据
- 星标
- 571
- 派生
- 80
- 平均合并
- 14 小时 43 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
forcedotcom/cli 的其他 Issue
-
sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShape可能已有人在做 @konkonrong-lgtm 于 72 天前认领。 未关闭area:afdx bug investigating owned by another team validated
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3625 · 4 条评论 ·
-
area:afdx bug owned by another team
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3608 · 2 条评论 ·
-
announcement
难度 1/5 1 小时以内 新手友好度 1/100
forcedotcom/cli#3668 ·
-
bug investigating validated
难度 3/5 1-2 天 新手友好度 66/100
forcedotcom/cli#3667 · 5 条评论 ·
-
[BUG]: NavigationMenu SourceMember name mismatch prevents source-tracked retrieve from completing未关闭bug investigating validated
难度 4/5 3-5 天 新手友好度 52/100
forcedotcom/cli#3660 · 3 条评论 ·
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 70/100
NCAR/miles-credit#526 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
FiloSottile/age#758 ·
-
package-request
难度 2/5 1-3 小时 新手友好度 63/100
ScoopInstaller/Main#8757 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
[bug]: shadcn add merges .env.example / .env.production into an existing .env.local instead of creating it可能已有人在做 @Gourav224 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复