Question

I'm just wondering if anyone else has seen this and if so, can you confirm that this is correct? The documentation claims, as you might expect, that 10,000 is the record limit for the system call:

Database.emptyRecycleBin(records);

not 200. Yet it's throwing an error at 200. The only thing I can think of is that this call occurs from within a batch Apex process.

Was it helpful?

Solution

This is the only reference that I could find to there being a limit of 200 on emptyrecyclebin(), I dare say that you are correct

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_emptyrecyclebin.htm

OTHER TIPS

It took a little over a week and me supplying a failing test case to salesforce support but the issue is now being reported as a salesforce known issue suggesting it may get addressed in the platform.

My workaround for now is to wrap the call in a Database.Batchable with the batch size to 200.

Adam, if you got shut down when attempting to log a case regarding this due to the whole Premier Support thing you should definitely escalate your case as it was handled incorrectly and SFDC needs to know about it. I had the same exact issue myself.

SOQL For Loops may be a helpful option for working around this limit as the 'for (Account[] accounts : [SELECT Id FROM Account WHERE IsDeleted = true ALL ROWS]' format provides batches of 200.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top