API - Change Order Lifecycle Change Pre Event Looping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a Vault 2012 Pro addin that modifies a word document attached to a change order as it progresses through different lifecycle states. I want to automatically update the word document to add the date on which the change order moves from an Approved state to closed (Set Effectivity) state. I added an event handler to my addin to hook into the UpdateChangeOrderLifecycleStateEvents.Pre event, and inside the event handler I check the activity id to capture the correct state change.
That all works fine. My problem comes in that the Pre event appears to be looping. The Pre event gets called 10-20 times in a row before it completes the state change. This results in many identical versions of my word document in the Vault.
I'm confused as to why the event is looping; I'm not actually editing the change order, just a file attached to it. Is there a way to prevent the event from firing multiple times?
