Timeline for Can the exact type of an Apex list be checked to choose between upsert and insert/update?
Current License: CC BY-SA 3.0
2 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 4, 2017 at 16:48 | comment | added | Keith C |
Thanks for answering. My scenario is a bit different in that the list gets created as either List<SObject> (that often only includes one type of SObject but can have more types) or List<Contact> (that has to only include one type of SObject). For the List<SObject> list, in addition to the type checking code you've posted that establishes one type only, to be able to do the upsert the correct type of list would have to be created via Type.forName and the items copied over. I'd like to avoid all that.
|
|
Sep 4, 2017 at 16:16 | history | answered | Tushar Sharma | CC BY-SA 3.0 |