• Venkateshwar Reddy Giri
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I have a Map
Map<String, List<sObject>> r2I = new Map<String, List<sObject>>();

----code to populate the Map... The sobject belong to different objects like Lead, Account etc so the Map basically is a medley of different objects.

Now want to extract the List for bulk insert so doing the following
list<sObject> sObjInsertLists = new list<sObject>();
for (String objType : r2I.keySet()) {
  sObjInsertLists.add(r2I.get(objType);
}

insert sObjInsertLists;

I keep getting the error "Incompatible element type List for collection of Sobject...". Is there a way to solve this?