Skip to content

Instantly share code, notes, and snippets.

@dancinllama
Created September 28, 2012 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dancinllama/3800800 to your computer and use it in GitHub Desktop.
Save dancinllama/3800800 to your computer and use it in GitHub Desktop.
partial success handling
//sobjList is my array of records inserted..
this.currentIndex = 0;
for(Database.SaveResult sr : Database.insert(objects,false)){
if(!sr.success){
exceptions.add(createException(batchId,sr.getErrors().get(0),sobjList.get(currentIndex)));
}
currentIndex++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment