sfpowerkit
sfpowerkit copied to clipboard
Namespace addressing issue
We have namespace orgs and unlocked 2GP packages. I use the generate patch and apply patch commands to update picklist values between versions.
First we are generating the patch using the command below. If I check the xmls the custom fields are not prefixed.
sfdx sfpowerkit:source:picklist:generatepatch -p "package_name"
Then we are applying the patch with the command below:
sfdx sfpowerkit:package:applypatch -n static_resource -u
Here we have the following behaviour:
- we need to prefix the static resource with the namespace, like prefix__static_resource
- we have the following errors because the namespace is not present in the generated metadata:
{ "changed":"false", "columnNumber":"13", "componentType":"CustomField", "created":"false", "createdDate":"2022-06-30T06:05:08.000Z", "deleted":"false", "fileName":"objects/SampleFeedback__c.object", "fullName":"SampleFeedback__c.Status__c", "lineNumber":"3", "problem":"Entity 'SampleFeedback__c' not found.", "problemType":"Error", "success":"false" }
{ "changed":"false", "columnNumber":"13", "componentType":"CustomField", "created":"false", "createdDate":"2022-06-30T06:05:08.000Z", "deleted":"false", "fileName":"objects/QuoteLineItem.object", "fullName":"QuoteLineItem.UnitofMeasure__c", "lineNumber":"3", "problem":"The global picklist cannot be resolved", "problemType":"Error", "success":"false" }
Switching to non-prefixed orgs would be quite hard in this moment. What is the recommended way to overcome this issue?
Many thanks, Marius
I will have a chat to the team and see what we come up with. Thanks!