I need a way to catch a change in a property value when the node is changed, say if I have a drop down with a status on it (Pending, Live, Finished) etc..
And someone changes the dropdown from pending to live, I need to be able to send an email - So I need to know that its actually been changed from one to another.
When they change and save you could tap into the save event? If you want email without the save and just on the dropdown change then think you would have to create your own datatype and that would need to send the email on drop down change?
Remember that Tom his solution only works if the user presses save and publish button. If the user just presses the save button the data in the NodeFactory is not updated and your check will not work.
Yep its fine anyway, it won't fire if they just save... But if they just save, then come back an hour later and save and publish it will still work as the cache would still be holding the old value.
Catch Change Of Property Value In Event?
I need a way to catch a change in a property value when the node is changed, say if I have a drop down with a status on it (Pending, Live, Finished) etc..
And someone changes the dropdown from pending to live, I need to be able to send an email - So I need to know that its actually been changed from one to another.
Any ideas?
Lee,
When they change and save you could tap into the save event? If you want email without the save and just on the dropdown change then think you would have to create your own datatype and that would need to send the email on drop down change?
Regards
Ismail
I don't know of a way to catch the raw values, but you could use NodeFactory vs the Document API and compare those. Have a look at this thread.
-Tom
@Ismail - I looked at the save, after and before and apparently you can't get the previous value - Toms solution seems good for now.
@Ismail - Awesome that'll work just fine thanks Tom :)
Remember that Tom his solution only works if the user presses save and publish button. If the user just presses the save button the data in the NodeFactory is not updated and your check will not work.
Jeroen
Yep its fine anyway, it won't fire if they just save... But if they just save, then come back an hour later and save and publish it will still work as the cache would still be holding the old value.
Great work around Tom just solved my issue. Thanks
is working on a reply...