All Collections
Troubleshooting
Salesforce validation errors
Resolving validation errors - "Couldn't locate layout section: <xxx> in layout <yyy>"
Resolving validation errors - "Couldn't locate layout section: <xxx> in layout <yyy>"

Resolution to this validation error often associated with CustomObjectTranslation and Layout metadata types

Valerio Chang avatar
Written by Valerio Chang
Updated over a week ago

Explanation of the error:

This Salesforce error that Gearset is surfacing is usually encountered when attempting to deploy a CustomObjectTranslation and Layout that belong to a managed package. This is due to a known bug of the Metadata API that removes the managed package prefix. This then causes an error when the namespace does not match or include the managed package layout tag.

Resolution:

To resolve this issue, you will need to add the layout tag back to your deployment or remove the managed package component from your deployment.
​
Gearset will notify you via our problem analysis of any attempted changes that may fail your deployment like so:
​

However, if you want to deploy the component listed above πŸ‘†, you will need to get more creative.
​
As stated above, you will need to manually edit the XML of your deployment package by following these instructions like so:
​

Under the <Layouts> tag, on the second line beginning with <layout>, which may look as below (example):

<layouts>
<layout>Example Object Layout</layout>
<sections>
<label><!-- Address Information --></label>
...
</sections>
...
</layouts>

You'd need to amend it to <layout>NameSpace__Example Object Layout>, as shown below:

<layouts>
<layout>NameSpace__Example Object Layout</layout>
<sections>
<label><!-- Address Information --></label>
...
</sections>
...
</layouts>


Note that the word "NameSpace__" referenced in line:
​<layout>NameSpace__Example Object Layout</layout>
refers to the name of your managed package that the layout is a part of.

You should not add the exact wording of "NameSpace__" to your XML file, as this will not resolve the error.
​
As per Salesforce documentation on Understanding Namespaces:
"A namespace is a 1-15 character alphanumeric identifier that distinguishes your package and its contents from other packages in your org."
​

Resolution if a failed component is deployed through a CI job

If the failing component in a CI or automation job, you may need to use our Environment Variables feature to apply and maintain those changes when pulling this metadata from your source.

Further examples of this Salesforce validation error can be found in:

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?