I have Map with Account and Account Id. I want to insert that accounts in Queueable and return list of all ids in order as acount is inserted(Or map, it doesnt really matther). How can i keep order if inserting list?
public with sharing class QueueableInsert implements Queueable {
Map<String,Account> oldIdToObject = new Map<String,List<SObject>>();
public QueueableImportRecords(Map<String,List<SObject>> oldIdToObject) {
this.oldIdToObject = oldIdToObject;
}
public void execute(QueueableContext context){
insert oldIdToObject.values();
}
}