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

dml on wrapper class list

can we perform dml on wrapper class list?
 i want to perform upsert operation on wrapper class list.
wrapper class dispaly two object data on vf and also able to enter data in one object on vf. n now i have to perform upsert operation on this list.
Pankaj PPankaj P
No, you cannot do dml operation directly on wrapper class list in apex. You need to segregate the list of 2 objects that are present in wrapper class just a for loop on list and 2 lists prepared and dml on each list.

Hope this helps you.
Hello Pankaj,
             i m very new to salesforce. can you provide some sample code for this