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
Marco ZeuliMarco Zeuli 

Custom Metadata Types - Subscriber editable field - Value overwritten by ANT deploy

Hi all,

I'm writing today because I need to clarify something about the Custom Metadata Types.
Here's my doubt:

let's say we have a Custom Metadata Type named X__mdt, with a Subscriber Editable field Y__c of type Text, we have a record named Z and that Z.Y__c is equals to "Yes". Record Z was deployed to Production Org using the Ant Migration Tool by our Developers.

Now due to a business needs an Administrator, in Production Org, updates record Z setting Y__c to "No".
What happen if a Developer makes a deploy, always using the Ant Migration Tool, and the package contains the record Z but with the field Y__c set to "Yes"?

According to the doc:
"Subscriber editable—Anyone with the correct permissions can change the value of the field at any time. Changes deployed by the developer don’t overwrite values in the subscriber’s organization."

What I were expecting was that after the deploy record Z would not be overwritten by the deploy, so field Y__c would still be set to "No".
I made a test, and that's not true. Record Z gets overwritten and the value of Y was back to "Yes".

What m'I missing here ?! 
 
NagendraNagendra (Salesforce Developers) 
Hi Macro,

Y__c will be overridden with the value in the metadata. This is expected behavior.

The meaning of 'Subscriber editable' is that the value can be controlled within the subscriber org, as opposed to only be controlled via the package. That means it can be updated via the UI, or an ant deployment.

You then need to decide whether to include your custom metadata in your ant deployments. On the one hand, it's great to have your code controlled and versioned, on the other hand, you run the risk of overriding important configuration in your production org.

Kindly mark this post as solved if the information help's so that it gets removed from the unanswered queue and becomes a proper solution which results in helping others who are really in need of it.

Best Regards,
Nagendra.P