4

I have a couple of values on the Account's Type field in a managed package. A couple of days ago I generated a package version successfully, but now when generating a new version I'm getting this message after the "Verifying metadata" step:

Account.[MyRecordTypeName]: Picklist value: [Value] in picklist: Type not found

I have no idea why it happens. The package has the standard value set declared, as well as its translations and the references in the record type file.

Has anyone experienced something similar when deploying or generating a new package?


Edit

This seems to be happening only when an ancestor package is specified when generating the version. If the ancestor is not specified, the error does not occur. This represents a difficult challenge because an ancestor package is required to enable upgrades.

2
  • 1
    I'm a little surprised this worked in the first place - Standard Value Sets are not packageable in 1GP or 2GP, and my experience has always been that one has to deploy them unmanaged into any org used to build or install the package. Am I misunderstanding the situation?
    – David Reed
    Jan 27, 2021 at 0:14
  • I honestly do not know. Now that you said it, I see that the documentation does state that "Changes to standard picklists can’t be packaged and deployed to subscriber orgs and picklist values deleted by the developer are still available in the subscriber’s org." There might be an error on Salesforce's end allowing me to generate that package version. Anyway, removing the field and creating a new minor version worked for me. Jan 27, 2021 at 13:18

2 Answers 2

3

The Special Behavior of Components in Packages documentation states that:

Changes to standard picklists can’t be packaged and deployed to subscriber orgs and picklist values deleted by the developer are still available in the subscriber’s org.

So - in theory - I should not be able to generate that package version at all.

I added a new custom field to the app with the values I required and removed the Type field references from my local files, and then I generated a new package version with a higher minor version number (1.2.2 -> 1.3.0). Then I was able to generate a new package version using this new version as the ancestor as it should be.

3

This is a known issue in Salesforce. The root cause is that the StandardValueSets are not supported by 2GP but have somehow been added to the package due to a bug in packaging. You can check the following Known Issue article to check if a fix is available.

https://trailblazer.salesforce.com/issues_view?id=a1p4V000002BgfoQAC

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .