Activity › Forums › Salesforce® Discussions › What are the setup and non-setup object?
-
What are the setup and non-setup object?
Posted by Saddam on September 11, 2019 at 2:55 PMWhat are the setup and non-setup object?
Laveena replied 6 years, 8 months ago 4 Members · 3 Replies -
3 Replies
-
Hi Saddam,
- Setup Object is:
1. Profiles
2. Users
3. Record Type - Non-Setup Object :
1. Lead
2. Account
2. Contact
4. Any Custom Object
- Setup Object is:
- [adinserter block='9']
-
Hi Saddam,
SetUp Objects:Setup objects are objects that are used to interact with the metadata. Common example is the User, Profile, Layout object.
Non-SetUp Object: Every other objects like those which are native(Standard Objects) and Custom Objects fall into the category of Non-Setup Objects.
One important note is that we cannot perform DMLs on setup and non-setup objects in the same transaction. Workaround is that you need to use asynchronous requests (@future) or use batch as it runs in its own system context.
In the test class, you can use System.RunAs with two different users to separate out transactions for setup and non-setup objects.
-
Hi Saddam,
A “setup” object is one that must be edited from the setup or builder area of the platform.
Setup objects are
* User
* RecordType
* Profile
etc
and all other general objects i.e.
* Contact
* Account
* Lead
etc
are the None setup objects.
If you run a DML operation on setup object you can’t run a DML operation on None setup object in the same context, it will show the “Mixed_DML_operation” error.
For example, you cannot insert an account and then insert a user or a group member in a single transaction.
Salesforce don’t allow you to run.
Thanks
Log In to reply.