Two questions, actually ...
First, here is a simplified version of my code:
public override void Init()
{
DocumentEvents.Insert.After += Document_Insert_After;
DocumentEvents.Update.Before += Document_Update_Before;
DocumentEvents.Update.After += Document_Update_After;
}
private void Document_Insert_After(object sender, DocumentEventArgs e)
{
EventLogProvider.LogInformation("DocumentEvents", "InsertAfter");
}
private void Document_Update_Before(object sender, DocumentEventArgs e)
{
EventLogProvider.LogInformation("DocumentEvents", "UpdateBefore");
}
private void Document_Update_After(object sender, DocumentEventArgs e)
{
EventLogProvider.LogInformation("DocumentEvents", "UpdateAfter");
}
Why do all of these events seem to fire twice when I save changes on the CMSDesk Form tab?
Second, is there a way to get the previous value of a field on this document type? I had thought to do something like this:
SessionHelper.SetValue("prevValue", e.Node.GetStringValue("FieldName", ""));
... in the UpdateBefore event and get the value back in the UpdateAfter event, but the value is always whatever I set the field (field type Multiple User Selector) to before I hit Save.
Thanks!