Skip to main content

Resolving validation errors - "ControlledByParent is not a valid sharing model for Asset" on Custom object metadata type

Cause and solution to this Salesforce validation error: "ControlledByParent is not a valid sharing model for Asset" Custom object

Written by Jacob Joshua

Explanation of the error

When deploying changes that include the Asset CustomObject metadata type, you may see the following validation error in Gearset:​
​"ControlledByParent is not a valid sharing model for Asset"

This error is returned directly by Salesforce and will block the deployment from completing.

Why this happens

Your Asset CustomObject metadata contains the following lines in the xml

<sharingModel>ControlledByParent</sharingModel>
<externalSharingModel>ControlledByParent</externalSharingModel>

This means the Asset record is configured to inherit its sharing from its parent Account. Salesforce will reject this configuration if the target org is not set up to support it, but the specific reason why can vary. The fix depends on your situation.

Solution 1: Enable Asset Sharing in the target org

When this applies: The target org has never had "Enable Asset Sharing" switched on, even though the source org has it enabled. When "Enable Asset Sharing" is not turned on, the Asset object doesn't have its own sharing configuration, it just inherits access from its parent Account.

Because of this, Salesforce rejects any deployment that tries to explicitly declare a sharing model for Asset, even ControlledByParent. Enabling the feature gives Asset its own sharing configuration, making the explicit declaration valid and allowing the deployment to go through.

Steps

  1. In the target org, go to Setup

  2. Search for "Asset Settings" or navigate to Feature Settings → Sales → Products → Asset Settings

  3. Enable the "Enable Asset Sharing" toggle

Once enabled, Salesforce will accept ControlledByParent as a valid sharing model for Asset and your deployment should proceed.

Note: This setting needs to be enabled in every org you deploy to.

Solution 2: Update the OWD in the target org

When this applies: The target org's Org-Wide Default (OWD) sharing setting for Asset is set to a value that conflicts with ControlledByParent in the metadata.

Steps

  1. In the target org, go to Setup → Security → Sharing Settings

  2. Click Edit

  3. Change the sharing setting for Account, Contract and Asset to match what your metadata expects from source.

Alternatively, if you intentionally want a different sharing model in the target org, you can update the metadata XML itself to match the target org's OWD setting:

xml

<sharingModel>Public Read Only</sharingModel> 
<externalSharingModel>Public Read Only</externalSharingModel>

Note: Changing the sharing model in your metadata will affect sharing behaviour across the org. Only do this if you intentionally want a different configuration in the target org.

Useful resources

For guidance on how to amend Asset Settings check Salesforce documentation:

More information on a possible resolution to this error can be found here:

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?