Skip to content

Invalid field in related list

Detection

  • RegExp: Error (.*) Invalid field:(.*) in related list:(.*)

Examples

  • Error Account-Account Layout Invalid field:SOLUTION.ISSUE in related list:RelatedSolutionList

Resolution

Field {2} of related list {3} is unknown in the target org. You can:
- Enable the feature or license that brings {2} in the target org
- Remove field {2}, or the whole related list {3}, from {1}
- If {2} exists in some orgs only, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-unknown-related-list --type xml-remove --files "**/layouts/*.layout-meta.xml" --xml-path "Layout/relatedLists[relatedList={3}]" --include-branches TARGET_BRANCH
Example of XML to remove:
<relatedLists>
  <fields>SOLUTION.ISSUE</fields>
  <fields>SOLUTION.SOLUTION_NUMBER</fields>
  <fields>SOLUTION.STATUS</fields>
  <fields>CORE.USERS.ALIAS</fields>
  <relatedList>RelatedSolutionList</relatedList>
</relatedLists>

Comments