Check if it value changed from ON to OFF on document save event
I have used simple contentservice event handler before to get a value on document save.
What I am wondering is how to go about checking if the field (say True/False field) is changed (from true to false, or false to true) on document save.
So I can initiate an email only if the value changed from previous set value.
Would appreciate if someone can shed some light on how to go about this.
I think you need "Saving" event, "sender" will be the current IContentService object and you will be able to get old data from the database and compare with current.
Check if it value changed from ON to OFF on document save event
I have used simple contentservice event handler before to get a value on document save.
What I am wondering is how to go about checking if the field (say True/False field) is changed (from true to false, or false to true) on document save. So I can initiate an email only if the value changed from previous set value.
Would appreciate if someone can shed some light on how to go about this.
Hi Keilo
Are you trying to intercept save event?
In save event you can just compare new value with old one and send an email with a new value of property.
Thanks,
Alex
Hi Alex
Yes I am intercepting the save(saving) event.
What is the cleanest (code) way to get the old value while Saving event? Do you happen to know?
I have seen an example that searched xml cache from few years ago and wondering if there is an efficient, modern way to do with 7.5.+
cheers
Hi Keilo
I think you need "Saving" event, "sender" will be the current IContentService object and you will be able to get old data from the database and compare with current.
Thanks,
Alex
Hi Alex
I am using the Saving event to check isDirty on the property temporarily.
Do you have a code snippet to get the old data easily? The ones I have come across looks archaic, and wondering if there is a better, simpler way.
cheers
is working on a reply...