Validator as Trigger

Posts   
 
    
DarkRoast
User
Posts: 42
Joined: 14-Jul-2010
# Posted on: 21-Mar-2011 07:09:13   

I'm trying to create the equivalent of an INSTEAD OF trigger using a validator.

I have an entity being validated and in the ValidateEntityBeforeSave method, I'm going to operate on a different entity than the involvedEntity. I then want to cancel the save for the involvedEntity without having to throw an exception.

Is that possible?

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Mar-2011 10:21:46   

An exception is required to cancel the transaction currently active, which can be deeply nested so an exception is the only safe remedy.

I'm not sure if this will wrk, but you may try looping on the fields and set IsChanged to false.