1 Antwort
Governor limits are checked before any rows are modified, so the allOrNone flag has no effect. Simply trying to modify a record past the 10,000th row will automatically result in a governor limit being thrown, and the entire transaction fails. If you think you might hit a governor limit, it's important that your code check using the Limits (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_limits.htm)beforehand.For a quick and dirty approach if I have more than 10,000 rows to update through anonymous apex I will sometimes do something like thisList<Thing__c> things = [select id from thing__c where status__c = 'Old value' limit 10000];for (Thing__c thing : things) { // make changes thing.status__c = 'New Value';}update things;Then run the script twice or whatever. This relies on the change you're making being something that you can filter in the where condition. Also this will get dull if there are many tens of thousands of records to update and you have to kick off the script again and again.For further suggestions check this discussion,https://salesforce.stackexchange.com/questions/15228/how-to-avoid-dml-insert-update-limit-of-10-000-rows-when-running-anonymous-apexLet me know if it helps you and close your query by marking it as solved so that it can help others in the future.Thanks.