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.

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.