function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bobby KnezevicBobby Knezevic 

Metadata API throwing Error: limit exceeded when deploying custom Case fields

When deploying custom Case fields to one of our sandboxes, the Metadata API is returning Error: limit exceeded failures on all custom fields defined in Case.object. Here is a portion of the build failure output:

[sf:deploy]
*********** DEPLOYMENT FAILED ***********
Request ID: xxx

All Component Failures:
1. objects/Case.object (Case.OC_Project_Due_Date__c) -- Error: limit exceeded (line 3594, column 13)
2. objects/Case.object (Case.Omni_Data_Uploaded_Allocations__c) -- Error: limit exceeded (line 3642, column 13)
3. objects/Case.object (Case.Omni_Data_Uploaded_Assets__c) -- Error: limit exceeded (line 3653, column 13)
4. objects/Case.object (Case.Omni_Data_Uploaded_Characteristics__c) -- Error: limit exceeded (line 3664, column 13)
5. objects/Case.object (Case.Omni_Data_Uploaded_Historical__c) -- Error: limit exceeded (line 3675, column 13)
6. objects/Case.object (Case.Omni_Data_Uploaded_Holdings__c) -- Error: limit exceeded (line 3686, column 13)
7. objects/Case.object (Case.Omni_Data_Uploaded_Performance__c) -- Error: limit exceeded (line 3697, column 13)
8. objects/Case.object (Case.Omni_Data_Uploaded_Personnel__c) -- Error: limit exceeded (line 3708, column 13)
.....

I checked the 'Limits' section for the Case object and it states we're using 2% of our custom Case field allocation (i.e. 15 of 800).

I've confirmed that there are no custom fields in the custom Case field recycle bin.

Anyone know if this is an underlying issue with Salesforce? Refreshing or creating a new sandbox each time we run into this issue is not a good option for us whatsoever.
James LoghryJames Loghry

Bobby, 
 

What Salesforce edition is your organization on?  It could be that you're hitting a different limit other than the number of custom fields on an object.  Potential other limits you could be hitting are:

Also, I see different lines added in your failure list.  Is there a trigger or apex class (or maybe java class?) that these coincide with?


 
Bobby KnezevicBobby Knezevic
Thanks for the attention, James. These errors are occuring during deployments using the Metadata API and have nothing to do with Apex code. This is a developer sandbox.

As noted in my original post, we're using 15 of the 800 allocated custom Case fields. API usage is at 870 of 5,000,000. This doesn't have anything to do with storage size as we're not not loading data, but just defining metadata. Some other error is likely the scenario. This is very troubling for us under the circumstances. =(
James LoghryJames Loghry
Since this is a sandbox, why not just try a change set to bring the Case fields over instead?
Bobby KnezevicBobby Knezevic
Change sets are not an option for us. We have an automated process in place to retrieve and deploy metadata from env to env using Ant, the Metadata API, and Team City.
Bobby KnezevicBobby Knezevic
My understanding is that Salesforce uses the Metadata API under-the-hood for change set deployments/management. To confirm this I created a change set with a bunch of custom Case fields and deployed to the problematic sandbox. It failed with the same limit errors. This has happened to two of our developer sandboxes now. This is seems to be a repeatable, underlying issue with the Salesforce platform that needs to be addressed. It goes without saying, the sooner the better.