Skip to main content

Resolving validation errors - "The facet Facet-<xxx> is defined by a component in the FlexiPage but not actually used."

Cause and solution to this Salesforce validation error surfacing on Lightning page (FlexiPage) metadata type

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated this week

Error overview

You may run into this Salesforce validation error when deploying Lightning page (FlexiPage) metadata. The error is commonly related to a specific line(s) of code within the FlexiPage referenced in the error message.

For example, on below screenshot we're seeing:

The facet Facet-<xxx> is defined by a component in the FlexiPage but not actually used. - where <xxx> references a specific Facet ID within the XML of the FlexiPage.

Explanation of the error

Based on our understanding of this issue, the error happens because the XML of the FlexiPage that you're deploying contains either an empty or unused regions.

This region(s) may need to be removed from the XML in order for the validation to succeed.

For example, an incorrect XML may look as below:

On the above preview of the XML, we're seeing that value beginning with Facet-4fd4079c isn't used in the FlexiPage, so removing it from the XML should help and fix the issue.

Based on Salesforce's documentation on FlexiPage metadata, the correct XML structure where a Facet ID is used within the FlexiPage should look as below:

Resolution

Workaround for PR validation in Gearset Pipelines

If you're using Gearset Pipelines to validate your PR, follow these steps:

  • In your Git provider (e.g. GitHub, AzureDevOps etc), make a change directly in the feature branch from which the failing PR was opened.

    • Make sure you remove the empty or unused Facet ID value (usually, this should be the Facet ID referenced in the error message).

    • Note: make sure not to amend Gearset's promotion branch (of which name normally begins with gs-pipeline/xxx).

  • Once the change is made, you're good to re-run your PR validation in the Pipeline. This should hopefully fix error and let the PR validation succeed.

Workaround for org to org validations

If you're running an org to org validation in Gearset using our Compare and deploy tool, follow these steps:

  • Consider downloading your deployment package from Gearset. For guidelines on how to, follow the steps from this article: How can I change the deployment package before deploying?

  • Once you've downloaded the package, amend the XML of the FlexiPage component referenced in the error message. Make sure you remove the empty or unused Facet ID value (usually, this should be the Facet ID referenced in the error message).

  • Once done, save the package in a .zip file, navigate to Gearset's Compare and deploy page, and use Local files option as the source of your new comparison.

    • This option allows you to upload your amended .zip package, and use it as the source of your comparison/deployment.

Useful resources

Salesforce StackExchange forum

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?