sfpowerkit icon indicating copy to clipboard operation
sfpowerkit copied to clipboard

Namespace addressing issue

Open MariusToth opened this issue 2 years ago • 1 comments

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

MariusToth avatar Jun 30 '22 07:06 MariusToth

I will have a chat to the team and see what we come up with. Thanks!

Caitlyn-Mills avatar Jul 07 '22 09:07 Caitlyn-Mills