Savepoint and rollback
A savepoint marks a spot in the current transaction; Database.rollback undoes every DML made after it, with no Recycle Bin trace.
Your task
Insert a tagged Account after a savepoint, roll back, and prove the row is gone while the Id stays on the variable.
String tag = 'AS-ROLLBACK-' + UserInfo.getUserId() + '-' +
String.valueOf(Datetime.now().getTime());
Savepoint checkpoint = Database.setSavepoint();
Account acct = new Account(Name = tag, Description = tag);Requirements
insert acct;should be present after the savepointDatabase.rollback(checkpoint)should be presentBefore rollback: 1should be printedAfter rollback: 0should be printedId still set: trueshould be printedEven in recycle bin: 0should be printed