Undoing things in DI
I'd like to be able to "undo" DI operations.
Like the SQL Transaction which allows an entire set of command to be committed together or not done at all, I would like to be able to do that with the DI. Is that possible?
The problem I'm facing is adding many SpecialPrices records. I want that either all the records are entered correctly, or none is entered. Currently, it is possible that some record would have an error and the records before that would be added correctly, but that means that not all the records were added, and keeping track of want was successful and then remove it seems an overhead.
Ad Kerremans replied
The Company object has a StartTransaction and EndTransaction method to accomplish what you want
do a StartTransaction at the beginning
if all is correct do an EndTransaction(Commit)
else do an EndTransaction(Rollback).
I suggest to look in the SDK Helpcenter for a sample,.