How to Quick Fix:

Exceeded the allowed number of fields to track on a given entity

The Salesforce API returns error messages when it can’t deploy metadata. Learn more about the error, what the cause is and how you can fix the problem.

In this article, we’ll guide you through understanding and resolving a specific Salesforce API error related to field tracking limits: "exceeded the allowed number of fields to track on a given entity." We'll delve into the root cause of this error, discuss why Salesforce imposes these limits, and provide practical steps to fix it, including both simple tweaks and more complex solutions.

If you see this Salesforce error message:

objects/Account.object: exceeded the allowed number of fields to track on a given entity

Try this quick fix:

  1. Turn off history tracking for fields where you don’t need it, to stay below the total limit of 20 fields.

This error is caused by Field History Tracking.

Salesforce has strict limits on the number of fields that you can customize. Most people are familiar with these field limits. For example, a Developer Edition org can have up to 500 custom fields, while Unlimited and Performance allows 800 custom fields in total.

However, there is a much smaller limit for the Field History Tracking feature, regardless of your Salesforce edition. History tracking cannot be turned on for more than 20 fields, counting all fields of all objects in your org.

Other Solutions

If you can’t turn off history tracking, try the following alternatives:

Create a Custom Object to track history.

For the very technically inclined, there is a cool Stack Overflow suggestion that explains how to create a Custom Object and an Apex trigger for tracking history, sidestepping the Salesforce feature completely. You can find example code there. This is a complicated solution for advanced users.

Contact Salesforce Support to increase the limit.

Try to contact Salesforce support and ask for the limit to be increased. We have heard of people getting this limit increased to a maximum of 50 fields, but no more. This may not be available for all users. Your mileage may vary.

FAQ

What is the Salesforce API error "exceeded the allowed number of fields to track on a given entity" about?

  • The Salesforce API error "exceeded the allowed number of fields to track on a given entity" indicates that you have surpassed the Salesforce's limits for tracking field history. These custom field limits in Salesforce restrict the number of fields that can be tracked.

How can I fix the "exceeded the allowed number of fields to track on a given entity" error in Salesforce?

  • To fix the "exceeded the allowed number of fields to track on a given entity" error in Salesforce, you can turn off history tracking for fields where it's not required. This helps you to remain below the total limit of 20 fields.

What causes the Salesforce error "exceeded the allowed number of fields to track on a given entity"?

  • The error "exceeded the allowed number of fields to track on a given entity" in Salesforce is caused by exceeding the Field History Tracking limit. Salesforce's custom field limits only allow tracking for up to 20 fields across all objects in your org.

What are Salesforce's custom field limits?

  • Salesforce's custom field limits vary based on the edition you have. A Developer Edition org can have up to 500 custom fields, while Unlimited and Performance editions allow 800 custom fields in total.

Are the custom field limits in Salesforce the same across different editions?

  • No, the custom field limits in Salesforce differ among its various editions. Developer Edition permits up to 500 custom fields, whereas Unlimited and Performance Editions allow for up to 800 custom fields.

What is the maximum number of fields for which I can enable history tracking in Salesforce?

  • Salesforce imposes a limit on the number of fields for which you can enable history tracking. Regardless of your Salesforce edition, history tracking cannot be turned on for more than 20 fields, counting all fields of all objects in your org.

How can I sidestep the field history tracking limit in Salesforce?

  • To sidestep the field history tracking limit in Salesforce, advanced users can create a Custom Object and an Apex trigger for tracking history. This solution bypasses the Salesforce feature entirely.

Can I request Salesforce Support to increase the field history tracking limit?

  • Yes, you can try contacting Salesforce Support to request an increase in the field history tracking limit. However, increases to a maximum of 50 fields have been reported, and this may not be available for all users.

What is Field History Tracking in Salesforce?

  • Field History Tracking in Salesforce is a feature that lets you track changes to the values of fields. However, Salesforce has strict custom field limits on the number of fields that can be tracked, which is limited to 20 fields.

What are the custom field limits for Developer Edition and Unlimited and Performance Editions of Salesforce?

  • The custom field limits for Developer Edition and Unlimited and Performance Editions of Salesforce are 500 and 800 custom fields respectively.

Is it possible to exceed the limit of 50 fields even after contacting Salesforce Support for an increase?

  • No, even after contacting Salesforce Support for an increase, the field history tracking limit can only be increased up to a maximum of 50 fields.

How can creating a custom object and Apex trigger help in bypassing the Salesforce field tracking limit?

  • Creating a custom object and Apex trigger can help bypass the Salesforce field tracking limit by enabling you to track history outside of Salesforce's built-in feature. This solution is recommended for technically inclined users.

Can all Salesforce users request an increase in the field history tracking limit?

  • It's not guaranteed that all Salesforce users can request an increase in the field history tracking limit. While some users have reported a successful request for an increase up to 50 fields, it may not be available for everyone.

Are there any other solutions if I can't turn off field history tracking in Salesforce?

  • If you can't turn off field history tracking in Salesforce, other solutions include creating a Custom Object for tracking history or reaching out to Salesforce Support to ask for an increase in the limit.

What is the maximum number of fields that Salesforce Support might increase the field history tracking limit to?

  • Salesforce Support may increase the field history tracking limit to a maximum of 50 fields. However, this is not a guaranteed solution and may not be available to all users.