Why can't I delete a field in the Contact object that is being referenced by a criteria-based Sharing rules if the Sharing is "Controlled By Parent"?
|Knowledge Article Number||000205508|
|Description||I can't delete a custom field on the Contact object because it is referenced on a criteria-based sharing rule.
The error message I receive is "Unable to Complete the Requested Change" and it mentions that "This custom field is referenced elsewhere in salesforce.com" as shown below:
This field and the criteria-based rule were created before the activation of Person Accounts. Since person accounts have been enabled, I cannot access the criteria-based sharing rule and delete it in order to be able to delete the custom field. What can I do?
|Resolution||Please note, this scenario occurs when the Organization-wide Defaults of the org are changed to "Controlled by Parent". This is one of the mandatory steps when you want to enable Person Accounts.
There are two possible solutions:
If you don't have "Person Accounts" enabled
You can change back the sharing organization-wide defaults from "Controlled by Parent" to any other (Private, Public Read Only, Public Read / Write). If you don't want to change it please continue to the next section.
If you have "Person Accounts" enabled
The first thing we need would be to obtain the Id of the criteria-based sharing rule, for this we can use Workbench.
Open Workbench, click on Info - "Metadata Types & Components" - Select the "ContactCriteriaBasedSharingRule and you would obtain the rule Id.
Once you have that you can access the rule via the User Interface with the following URL:
Where "instance" is your salesforce instance / domain and the "id=" variable needs to be changed with the Id you obtained previously.
You can also delete the Rule by using the following URL:
Where "instance" is your salesforce instance / domain and the "delID=" variable needs to be changed with the rule Id, as mentioned previously.
You'll get an error message related to your session but you will be able to remove the rule if you click the "Delete" link highlighted below.
After removing the Criteria-Based Sharing Rule you will be able to delete the field without any errors.