Question
Before delete object, run validation and cancel delete if failed
08:49 Jun 08, 2022
Hi,
I need to add a validation process before a record is deleted to ensure it can be deleted.
I tried using the 'Before record deleted' event in the Object structure and call the validation from the object process.
My problem is that I don't know how to cancel the delete action when validation fails.
Any ideas?
Thanks,
Chani
Like
1 comments
15:29 Jun 08, 2022
Hi Chani,
Throw any exception in the method you call when the before delete signal is started and the record will not be deleted. Something like:
public void ThrowDeleteException() { throw new InvalidOperationException("Can't delete"); }
Best regards,
Oscar
Show all comments