Change set validation may delete an object's sharing rules
Last updated 2018-05-17 ·Reference W-2792105 ·Reported By 7 users
When a change set contains a relationship field where the source environment's field type is Master-Detail and the target environment's field type is lookup with differing org-wide defaults (OWD) for the field's object in each environment, validating a change set causes sharing rules built on said object in the target environment to be deleted.
If the org-wide defaults for the relationship field's object in the target environment mismatches the validation does not commit the OWD change however, existing sharing rules are unexpectedly deleted from the object.
1. In the source environment create a custom object and create a Master-detail relationship with the Account object.
2. In a target environment create the same custom object but instead of a Master-detail field type create a custom field lookup relationship to Account. Note: Be sure that you are using the same API names for the custom object and fields in both the source and target environments:
3. Set the OWD for the custom object to Controlled by Parent in the source environment.
4. In the target environment set the OWD to Private and create a few sharing rules.
5. Create a custom object record in the target org.
6. Create a change set from the source environment containing the Custom Object and the relationship field and upload.
7. In the target environment select to validate the inbound change set.
Actual Results: The custom object's sharing rules are removed in the target org upon validating the change set and their provided record access is revoked for users.
Expected Results: As per the informational message before validating, no changes should be made in the target organization since this is only a validation and not an actual deployment:
"This will simulate deploying the change set, generating the success or failure messages you would receive with an actual deploy. No changes will be saved, but you will be unable to make changes to your organization while the operation is in progress."
None at this time.
Do not include relationship fields in your change set if the field type and resulting org-wide defaults are different between the source and target environments.
You will need to manually re-create any deleted sharing rules.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.