Can you hold a list of Id's as a SObject list data type?

List SDR_IDs = new List(new Map([SELECT Id FROM user WHERE UserRoleId = '00E6A000000UW7gUAG' and IsActive = true]).keySet());

Let me know. I guess more generally, what I am asking is what values can the SObject class hold? Is it only default and custom apex objects or can it also hold integers, booleans, IDs, etc.

1 Answer 1


sObject can only hold records, such as Account or CustomObject__c. To hold any type, you can use Object, which is the parent object for all types.

  • You're the real god - Thank you Oct 9, 2019 at 13:26

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.