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
surendrasurendra 

what is setup objects and non setup objects can any one explain clearly

Navatar_DbSupNavatar_DbSup

Hi,

 

you can diffrentiate your setup and nonsetup object

Action chaining is a technique to handle the infamous "MIXED_DML_OPERATION, DML operation on setup object is not permitted Error" problem.
You may not know it but there are two types of objects that you can interact with on the platform. One is "setup" object and the other is a "non-setup" object. A "setup" object is one that must be edited from the setup or builder area of the platform. These object include the User object, Ogranization object, Email templates and so on.
See this article for details DML operations of a non-setup sObject and a setup sObject

http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_dml_non_mix_sobjects.htm?SearchType=Stem

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. ?

surendrasurendra

Thanks for ur valuable infrmation

sunny.sfdcsunny.sfdc
Setup objects are those which interacts with metadata like User, Profile, Layout etc. All other object (Standard and Custom) are non setup object. 

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/reference_objects_setup.htm

One important note is that we cannot perform DMLs on setup and non setup objects in same transaction. Workaround is that you need to use asynchronous requests (@future) or use batch as it runs in its own system context.

In test class you can use Sytem.RunAs with two different users to separate out transactions for setup and non setup objects. 

Hope this helps.

Regads
S