I have a feature that updates page layouts using the Apex Metadata API. When we are testing it when it is installed, the deployment fails when trying to update a field on that custom metadata type. Reading through the documentation it seems like I would be able to do this. The packaged custom metadata records and the Apex code are in the same namespace. Has anyone ran into this?
1 Answer
I figured it out. It is because the custom metadata field that I was trying update had a field Manageability of Upgradable. Changing that to Subscriber editable was the solution
-
I have similar requirements: In my managed package, I need to add custom metadata type which I want to be updateable only by my packaged apex code (calling one global method of my package from anonymous window console from subscriber org). My configuration for custom metadata type is : Type is protected, field manageability is 'subscriber-editable' and record itself would be protected as well. I am adding initial record as part of package then want to update that record using apex. Would that work? Oct 31, 2018 at 21:21
-
I have similar issue, can you help : salesforce.stackexchange.com/questions/253867/…– AbhishekMar 14, 2019 at 14:33