1

I've got a managed package built with 2GP packaging which always returns errors if I try create new version with the ancestorVersion set. I'm not a total noob to this, as I have other packages built with 2GP where upgrades like this can be built.

The actual error message is:

nebc__SendGrid_Email__c.Recipient_Name__c: Cannot modify managed object: entity=CustomFieldDefinition, component=00N5B000002Odu8, field=AggregateRelationshipName, state=released,

There is an error like this for all of the formula fields on the nebc__SendGrid_Email__c object. I have not changed them from one version to another. Also, as far as I understand, I should be able to change the formula in a formula field between releases, just not the developer name of the field.

So, I don't know how to proceed from here. There doesn't seem to be any way to get more detail on the errors.

I don't even understand all of the error message, what does the field=AggregateRelationshipName part refer to? The field is a formula field defined as:

IF(!ISBLANK( Nebula_IX_SG__Recipient_Override__c ),
  NULL, 
  IF(!ISBLANK(Nebula_IX_SG__Contact__c),
        Nebula_IX_SG__Contact__r.FirstName + ' ' + Nebula_IX_SG__Contact__r.LastName,
        Nebula_IX_SG__Lead__r.FirstName + ' ' + Nebula_IX_SG__Lead__r.LastName
  )
)

The other thing to note is that the nebc__SendGrid_Email__c object is provided by another 2GP that this one depends on, and adds a few fields to.

Until we install in a production org, I've been working around it by not setting ancestorVersion. Which means uninstalling, and re-installing to upgrade. The other option (which works) is to build as an unlocked package. But that's not ideal either.

1 Answer 1

0

Having spoken to the 2GP package team, there is a bug in generating upgrade versions of Managed 2GP packages containing formula fields.

They are going to fix it, but this feature is still Beta at the moment, so not highest priority to fix.

1
  • I have a similar issue, but for me is an error of a supposedly new mandatory field that cannot be added to pre-existing custom metadata object. I don't have formula fields in my package so maybe the issue is more generalised. Jan 21, 2019 at 17:05

You must log in to answer this question.

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