0
votes

I want to capture the Workflow SaveVersion event on a custom PageType so that I can update another unrelated system in real-time:

    WorkflowEvents.SaveVersion.After += Workflow_Save_After;

However, this event gets fired 4 times for each Save click, sometimes showing the changes I made before clicking on Save in the admin UI, but sometimes showing the old version. I have set up several Watch variables in Visual Studio so see if I can determine what is different each time the vent fires for a single save action, but the following variable values are always identical:

enter image description here

How do I know which event firing contains the changes I made?

1

1 Answers

1
votes

SaveVersion.After is triggered multiple times when saving a document(this is due to event being too general and code re-used multiple times during versioning process):

On checkout
On document update (saving values from UI)
Before check-in
During check-in

You can move your code to a handler to or other event depending on workflow type you are using WorkflowEvents.CheckIn.Before, which gets triggered only once per save.