-
Notifications
You must be signed in to change notification settings - Fork 78
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
sf project retrieve start --metadata 'CustomField:<namespace>__*' doesn't retrieve customfields from standard objects #3052
Comments
@rmartinez1ffdc I think you're right that this needs to be addressed. I'll mark it as a bug As for a workaround, have you tried `sf project retrieve start --metadata 'CustomField:*'. From my testing locally that will give you all the fields on a standard object:
|
This issue has been linked to a new work item: W-16959563 |
Hi @mdonnalley We have applied another workaround by specifying the name of the standard object since for our use case we need to be able to filter what we retrieve by namespace. Thanks for considering this issue that quickly |
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
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
The text was updated successfully, but these errors were encountered: