Want to delete lastly commited object

I have one microflow in that I need to commit object first but after that i need to delete the lastly commited object. how to fetch lastly commited object from db?  Anyone please suggest me. Thanks in advance,
2 answers

If you have the last changed field active on the attribute you could use that one. But this seems a very tricky method because other users could influance this. I would rather use some helper entity where I attach the object that needs deleting. Much safer.





Hi Akshay,

As Ronald mentions, it is tricky and prone to errors, so find an other way to do it. When throwing an error it will rollback all changes in the transaction, including the ones that are committed in the same transaction. In general a transaction starts at begin of a call of a microflow and is finished when has completed the run, including its sub microflows.

But if you need an answer how to delete the last item...

Retrieve by XPath, and sort on auto number attribute, or create / change date attribute, probably in combination with user who created the object (as you don’t want to delete an others users object)

Cheers, Andries