Skip to main content

Code reviews rule: Use of deprecated: AccountInsights and OpportunityInsights settings

Written by David Martin
Updated this week

Use of deprecated: AccountInsights and OpportunityInsights settings

Why is this an issue?

The AccountInsightsSettings and OpportunityInsightsSettings metadata types have been deprecated as of API version 59.0. Continuing to use deprecated metadata types may cause:

  • Deployment failures in future API versions

  • Incompatibility with new Salesforce features

  • Technical debt that becomes harder to address over time

Examples

Example of incorrect metadata (deprecated settings):

<!-- AccountInsightsSettings.settings-meta.xml -->
<AccountInsightsSettings>
<enableAccountInsights>true</enableAccountInsights>
</AccountInsightsSettings>
<!-- OpportunityInsightsSettings.settings-meta.xml -->
<OpportunityInsightsSettings>
<enableOpportunityInsights>true</enableOpportunityInsights>
</OpportunityInsightsSettings>

Example of correct approach:

Remove these deprecated settings files from your source repository and configure the replacement features through Salesforce Setup or the appropriate current metadata types.

How can I fix violations?

  1. Review usage: Identify where these settings are used in your org.

  2. Migrate to alternatives: Consult Salesforce documentation for recommended replacement features.

  3. Remove deprecated metadata: Delete the deprecated settings files from your source repository.

  4. Update API version: Ensure your metadata uses a current API version.

Resources

Did this answer your question?