Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • keilo 563 posts 1018 karma points
    Apr 24, 2017 @ 02:25
    keilo
    0

    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.

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Apr 24, 2017 @ 19:45
    Alex Skrypnyk
    0

    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

  • keilo 563 posts 1018 karma points
    Apr 25, 2017 @ 03:39
    keilo
    0

    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

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Apr 25, 2017 @ 16:35
    Alex Skrypnyk
    0

    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

  • keilo 563 posts 1018 karma points
    Apr 26, 2017 @ 03:52
    keilo
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies