Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Apexトリガーで使えるエラー判定
// Update処理
List<Database.Saveresult> results = Database.Update(accounts, false);
// Errorレコード判定
Integer i = 0;
for (Database.SaveResult sr : results) {
if(!sr.isSuccess()) {
Database.Error err = sr.getErrors()[0];
contactMap.get(accounts[i].Id).addError(
err.getMessage()
);
}
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.