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
Ashok Kumar NayakAshok Kumar Nayak 

Which 2 Objects can be inserted in a same transaction, choose 2. I came across this in my PD2 MCQ exam.

A. Account and Group

B. Account and AccountShare

C. Case and CaseComment

D. Oppotunity and User

I'm confused after I see https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_non_mix_sobjects.htm article. 

Best Answer chosen by Ashok Kumar Nayak
Rohit B ☁Rohit B ☁
Hi Ashok,
Where did you get confused?
According to me option B & C are correct. Please let me know your confusion.

All Answers

Rohit B ☁Rohit B ☁
Hi Ashok,
Where did you get confused?
According to me option B & C are correct. Please let me know your confusion.
This was selected as the best answer
Ashok Kumar NayakAshok Kumar Nayak
Actually I got confused with the article https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_non_mix_sobjects.htm, it says Group and User objects we can't use with other sObjects for DML operation, but then there're sub points which says we can only insert Group and User but other DML operations are not allowed.
Rohit B ☁Rohit B ☁
They may have missed to specify the version. I've done that and I'm pretty sure that we can't do DML operation on User & Group with any other sObject in a single transaction.
Whenever you have such type of confusion then just go to Anonymous Debug Window to run your code or in test class you can test.