2

We've been trying to patch with 2GP for a few months now but we're constantly hitting errors even when the only change is a comment in an apex class. Many errors were around reports so to try to get to a patchable state I've deprecated reports that were erroring but have hit a new error:

Opportunity.Custom Process: Picklist value: OpportunityStagePicklistValue not found

Our app has 5 custom picklist values in the Opportunity.Stage StandardValueSet which we use throughout the product via our custom SalesProcess mentioned in the error. According to the metadata coverage report StandardValueSets cannot be packaged as part of 2GP so my question is:

Why are these Opportunity.Stage values not an issue in a normal package but break for patches?

One theory I have is that packaging deploys the code to a scratch org which would also deploy the StandardValueSets (as they can be pushed to an org via the Metadata API) but patching doesn't (maybe it installs the ancestor instead of deploying?). Does anyone know if this is the case?

To answer some questions on what we've done:

  • Patching is enabled in our namespace org
  • The defined ancestor has been released
  • The ancestor has been security reviewed
  • The versionNumber has the same Major and Minor number as the ancestor with the patch version being increased by one
  • Still have a case open with Salesforce over this but it hasn't yielded anything so far
"ancestorId": "[email protected]",
"versionNumber": "1.172.1.NEXT",

This question does relate to the following but the suggested duplicate answer there wasn't the fix.

2gp Patching is Failing Even When the Only Change is a Comment

As always, any and all help is appreciated.

1 Answer 1

0

From Salesforce Support:

As per your question "If patching is meant to be supported in 2GP, is there a reason it fails when a StandardValueSet is included in the package."

-It’s not supported because StandardValueSet is not supported with 2GP as mentioned in this doc - https://developer.salesforce.com/docs/metadata-coverage/54

This supports my above theory on how patching works vs packaging. So as it stands right now, 2GP does not support StandardValueSets and as such depending on custom StandardValueSet values can break patching (even though you'll be able to package the same code no problem). This probably goes for all metadata types that are not supported by 2GP but can be deployed via the Metadata API (as per the Metadata Coverage Report).

To get around our inability to patch we ended up removing the metadata that was directly referencing the StandardValueSets. We can now patch no problem.

You must log in to answer this question.

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