Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 10834

An sObject represents an object, such as an Account or Campaign. An sObject is the base object for all objects in Apex.

18 votes
4 answers
10k views

Utility Methods flexible enough for all sObject Types

Thanks in advance for any help I can get with this EDIT: WORKING EXAMPLE public static List<sObject> getListFromMap (Map<Id,List<sObject>> object_map, String obj_type){ List<sObject> objects … = new List<sObject>(); Schema.SObjectType object_schema = Schema.getGlobalDescribe().get(obj_type); for(Id id : object_map.keyset()){ for (SObject obj : object_map.get(id) ) { …
Xtremefaith's user avatar
  • 4,590
6 votes
2 answers
2k views

Utility Method Returning Different Type (Set instead of List)

Previously I had posted this question awhile back: Utility Methods flexible enough for all sObject Types Now I want to expand my method a bit to return a Set<Object> instead of a List<Object> Here is … the original method: public static List<Object> getValuesByField (Type listType, List<SObject> records, SObjectField field){ List<Object> results = (Object[])listType.newInstance(); for(SObject
Xtremefaith's user avatar
  • 4,590