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>"

What to do when hitting the Validation error "Couldn't locate layout section: <xxx> in layout <yyy>"

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 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, it has to be added:

i.e.

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


to

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


Or if this is a 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 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?