5

I'm trying to get around the MIXED_DML_OPERATION. I touch some custom sObjects, custom settings, and than schedule a CronJob via System.schedule

The API Version of these classes is v19, and it's my understanding that Custom Settings are no longer included in the non-allowed 'setup objects' after V18.

Basically the same problem as described here.

This only seems to be happening after the package has been installed into a new org (Winter '13 Sandbox). Does anyone have a list of which objects are considered "Setup Objects"? Are custom settings still considered setup objects?

Update

Can't confirm that my sandbox (CS4) is where I'm able to recreate so I'm assuming it's on Winter 13 but not positive. Either way, not able to recreate in a Partner Dev org.

  • It only affects the 180.6 build of salesforce which is on all winter13 sandbox orgs, I'm not sure if NA1 is on this build or not. – ca_peterson Oct 2 '12 at 21:08
  • I don't think this org was explicitly requested as a Winter 13 preview? Is CS4 on Winter '13? – jordan.baucke Oct 2 '12 at 21:14
  • Yes, CS4 is on Winter '13. You don't explicitly request for being part of an upgrade - it all depends on if you're already on an instance scheduled for early upgrade or not. There's more info on the upgrade process here >> salesforce.stackexchange.com/questions/1674/… – JLiljegren__c Oct 2 '12 at 21:21
  • Ok that makes sense. I can't confirm, but I would assume that the customer whom ran into this in my code is also test in a sandbox instance, but waiting for feedback from them. – jordan.baucke Oct 2 '12 at 21:24
  • Please note, there are also Production instances on Winter '13, e.g. the new early adopter instance NA1. – JLiljegren__c Oct 2 '12 at 21:43
7

It's a bug with System.Schedule and System.abortJob; salesforce reference number is W-1400761. The fix is tentatively scheduled for sometime Thursday (10/4/2012).

Latest comments from SF partner premier support (who actually are helpful on this stuff!) is:

"I had requested for the information from Tier 3 and they have informed that there were some modification made and it was a regression issue. We will be reverting back to the previous process and so you do not require to do any changes to your code. Currently the proposed date for the patch release is Thursday 4th Oct."

As commented above, this issue affects the 180.6 (aka the 6th patch to Winter13) build of salesforce, which is what is currently running on all Winter13 sandbox orgs, I'm not sure if NA1 is on it or not yet.

Edit: Confirmed fixed as of today (10/4).

|improve this answer|||||
  • thanks @ca_peterson going to keep an eye on it till tomorrow. – jordan.baucke Oct 2 '12 at 20:59
  • @metadaddy thanks for that edit, I appear to be exceptionally bad with numbers today. – ca_peterson Oct 2 '12 at 21:04
3

Here's a list >> sObjects That Cannot Be Used Together in DML Operations

From what I can read in this list, custom settings should not be considered setup objects in version 17 and later.

Some sObjects require that you perform DML operations on only one type per transaction. For example, you cannot insert an account, then insert a user or a group member in a single transaction.
The following sObjects cannot be used together in a transaction:
- FieldPermissions
- Group
- [...]
- Custom settings in Apex code that is saved using Salesforce.com API version 17.0 and earlier.

Can you verify that not some part of your code is running v16 or earlier, which, I believe, would "downgrade" the entire transaction to that version.

|improve this answer|||||
  • I can confirm that the earliest version this code is on on V19. I don't touch any of those objects listed. – jordan.baucke Oct 2 '12 at 20:58
  • 1
    Just noticed @ca_peterson got you going in the right direction already - great. The versioning was the only thing I could think of. – JLiljegren__c Oct 2 '12 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.