function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
steve_andersensteve_andersen 

Can't use MetadataAPI to modify objects installed via package?

I was just playing with the latest metadata api with a new customer of mine. We have a whole bunch of custom objects and code in a private package. We installed it the other day, and then I tried to add a field to an object with the metadata api. I got this error:

Save error: Cannot add new entity into an installed package (attempted to add type CustomField named ONEN_Household__c.Junk__c)

Which sounds like once I install code via a private appexchange, it won't be modifiable. Is that behavior expected with the metadata api?

For me it would mean that I have to ditch the idea of packaging and go to a full metadata API deployment model where we don't package stuff up, but instead drag text files around. Is that right?

Thanks,
Steve
steve_andersensteve_andersen
Can anyone at Salesforce.com verify that this is expected functionality moving forward? If the metadata API doesn't play nicely with installed packages, its utility goes way down in my estimation.

I'd love to know one way or the other on this to plan for post-June deployment of code.

Thanks,

Steve
SuperfellSuperfell
It looks like your package was a managed package, in which case the regular managed package rules apply (regarding what can be changed post install) regardless of how you're trying to make those changes (the setup UI, or the metadata API).
steve_andersensteve_andersen
Thanks Simon.

The package I am trying to add to is not a managed package. It was installed from another instance of mine, and is unmanaged, and the checkbox on the package verifies that.

I tested with another installed package on this developer org and got the same result.

So, it appears I can not add a new field to an object into an unmanaged package installed from another org.

Steve