I've been running ant deploy all day yesterday on an org of mine with no problems. Before each deployment, I ran an undeploy to delete everything I had deployed previously.

In the middle of the day, I ran into this error while deploying: "objects/Opportunity.object (Opportunity.BillingOrganization__c) -- Error: limit exceeded (line 818, column 13)."

I'm nowhere near hitting any storage limits, nor am I close to hitting any custom field limits. There are no fields available to be undeleted and nothing in the org's recycling bin. I am able to create a custom field manually in my org. I also ran an ant deployment on another org of mine with no problems.

Here is the org's System Overview: https://i.stack.imgur.com/lCYnB.jpg

Does anyone know what is going on? Thank you.

  • How much custom fields are on opportunity? What is the total length of all text fields?
    – kurunve
    Feb 23, 2017 at 19:18
  • There are currently no custom fields on any object. What do you mean by total length of text fields?
    – axiong
    Feb 23, 2017 at 19:19
  • Just a wild guess..May be you have a opportunity record already in the org with BillingOrganization__c field value and with the new deployment, you may be trying to reduce its field length..Again just a wild guess.
    – javanoob
    Feb 23, 2017 at 19:34
  • I deleted all opportunity records from my org and tried a deploy again and got the same error. Thanks though @javanoob
    – axiong
    Feb 23, 2017 at 19:41
  • Are you trying to make BillingOrganization__c field as external id?
    – javanoob
    Feb 23, 2017 at 19:42

3 Answers 3


Ended up making a case about this issue. Support ran a Physical Delete (PD) on my org to delete custom fields that have been deleted but still remain. Deployments are working now.

I've also asked about the purgeOnDelete flag when running an ant undeploy job. Here is their response:

"That's slightly different. Essentially, the OnDelete flag puts the field in a 'hard' deleted state. We then have a sweeper program that will remove these later ('physical delete'). This is random and usually occurs nightly. In situations like ours here, we can manually run the physical delete, instead of waiting for it to occur organically."

  • Good to know that. Thank you for posting support's response. Feb 24, 2017 at 22:59

In our case I checked Setup > Background Jobs 

There was a Job Type there called "Cleanup of custom field data when a custom field definition is hard deleted"

The Status showed "Completed" so I retried my deployment validation and this time it completed successfully.


you need to permanently delete fields which you have deleted while deployment. This is causing the fields to reach it's limit. Deleted fields which needs to be deleted permanently are listed at the bottom of custom fields in your object. See below screen shot.

enter image description here

Click on deleted fields link and erase all fields listed there.

  • Sorry, I guess I was unclear when I said that there are no fields waiting to be undeleted. I do not see a Deleted Fields list under any object.
    – axiong
    Feb 23, 2017 at 19:21
  • Sounds weird. is this a new org? If it is, i would try creating a new org and then do this deployment there. And then raise a salesforce ticket to know the root cause? Feb 23, 2017 at 19:29
  • This is a fairly new org. I ran a deployment on another org of mine and it succeeded. Thanks, I guess I'll have to raise a ticket.
    – axiong
    Feb 23, 2017 at 19:31
  • Yeah, because i remember we faced a similar issue before and we tried deploying in a new org. but we never got back to salesforce on why this is failing. may be you can post it :) Feb 23, 2017 at 19:33
  • Sarath, I logged a case and posted their solution and response as an answer in case you were still curious about this. Many thanks.
    – axiong
    Feb 24, 2017 at 22:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .