Open rmartinez1ffdc opened 1 month ago
@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:
❯ sf project retrieve start --metadata 'CustomField:Account*'
Retrieving v61.0 metadata from test-xolxqlblsmay@example.com using the v62.0 SOAP API
Preparing retrieve request... Succeeded
Retrieved Source
==============================================================================================================================
| State Name Type Path
| ─────── ───────────────────────── ─────────── ──────────────────────────────────────────────────────────────────────────────
| Changed Account.AccountNumber CustomField force-app/main/default/objects/Account/fields/AccountNumber.field-meta.xml
| Changed Account.AccountSource CustomField force-app/main/default/objects/Account/fields/AccountSource.field-meta.xml
| Changed Account.AnnualRevenue CustomField force-app/main/default/objects/Account/fields/AnnualRevenue.field-meta.xml
| Changed Account.BillingAddress CustomField force-app/main/default/objects/Account/fields/BillingAddress.field-meta.xml
| Changed Account.CleanStatus CustomField force-app/main/default/objects/Account/fields/CleanStatus.field-meta.xml
| Changed Account.DandbCompanyId CustomField force-app/main/default/objects/Account/fields/DandbCompanyId.field-meta.xml
| Changed Account.Description CustomField force-app/main/default/objects/Account/fields/Description.field-meta.xml
| Changed Account.DunsNumber CustomField force-app/main/default/objects/Account/fields/DunsNumber.field-meta.xml
| Changed Account.Fax CustomField force-app/main/default/objects/Account/fields/Fax.field-meta.xml
| Changed Account.Industry CustomField force-app/main/default/objects/Account/fields/Industry.field-meta.xml
| Changed Account.Jigsaw CustomField force-app/main/default/objects/Account/fields/Jigsaw.field-meta.xml
| Changed Account.NaicsCode CustomField force-app/main/default/objects/Account/fields/NaicsCode.field-meta.xml
| Changed Account.NaicsDesc CustomField force-app/main/default/objects/Account/fields/NaicsDesc.field-meta.xml
| Changed Account.Name CustomField force-app/main/default/objects/Account/fields/Name.field-meta.xml
| Changed Account.NumberOfEmployees CustomField force-app/main/default/objects/Account/fields/NumberOfEmployees.field-meta.xml
| Changed Account.OperatingHoursId CustomField force-app/main/default/objects/Account/fields/OperatingHoursId.field-meta.xml
| Changed Account.OwnerId CustomField force-app/main/default/objects/Account/fields/OwnerId.field-meta.xml
| Changed Account.Ownership CustomField force-app/main/default/objects/Account/fields/Ownership.field-meta.xml
| Changed Account.ParentId CustomField force-app/main/default/objects/Account/fields/ParentId.field-meta.xml
| Changed Account.Phone CustomField force-app/main/default/objects/Account/fields/Phone.field-meta.xml
| Changed Account.Rating CustomField force-app/main/default/objects/Account/fields/Rating.field-meta.xml
| Changed Account.ShippingAddress CustomField force-app/main/default/objects/Account/fields/ShippingAddress.field-meta.xml
| Changed Account.Sic CustomField force-app/main/default/objects/Account/fields/Sic.field-meta.xml
| Changed Account.SicDesc CustomField force-app/main/default/objects/Account/fields/SicDesc.field-meta.xml
| Changed Account.Site CustomField force-app/main/default/objects/Account/fields/Site.field-meta.xml
| Changed Account.TickerSymbol CustomField force-app/main/default/objects/Account/fields/TickerSymbol.field-meta.xml
| Changed Account.Tier CustomField force-app/main/default/objects/Account/fields/Tier.field-meta.xml
| Changed Account.Tradestyle CustomField force-app/main/default/objects/Account/fields/Tradestyle.field-meta.xml
| Changed Account.Type CustomField force-app/main/default/objects/Account/fields/Type.field-meta.xml
| Changed Account.Website CustomField force-app/main/default/objects/Account/fields/Website.field-meta.xml
| Changed Account.YearStarted CustomField force-app/main/default/objects/Account/fields/YearStarted.field-meta.xml
This issue has been linked to a new work item: W-16959563
Hi @mdonnalley Yes, that would retrieve the custom fields but also any other not related to the namespace we need.
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
Hi @mdonnalley, Do you have an expected date to work on this bug? This is also affecting me and my team. Thanks!
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/mycustomfieldnspc.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>__*'
returnsNothing 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
: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