Page 1 of 1

Code Document Delete Event

PostPosted: Thu Aug 24, 2006 1:52 am
by informationarchitects
When rejecting/deleting a document in Ascent Capture, we would like the rejected/deleted document’s fields stored in a separate database. This rejection/deletion is performed usually during validation. Our staff has to re-enter the information for rejected/deleted document information.

If possible provide some sample code that involves the use of kofax functions / events:
ActionEvent
kfxOcxEvent
kfxOcxEvent_ContentChanged

how do we get the Reference of BatchChanges Object in the KfxOcxEventContentChanged.

Post Elaborated

PostPosted: Thu Aug 24, 2006 2:50 am
by informationarchitects
I want to Record Information about the Deleted Documents in a Database. To Accomplish this i am writing a custom panel.

According to Kofax Documentation KfxOcxEventContentChanged will occur when any document is deleted. I tested it and found it correct.

The AC Documentation also states that the references of deleted document will be available from the BatchChanges Object which is only available in KfxOcxEventContentChanged.

But the Documentation doesnot state how can i get the reference of this object in the Event. :?: :x

Does anyone know how to get reference of this object :?: :?: :?:

Or any other way by which i can track deleted documents :?: :?: :?: :?:

Re: Code Document Delete Event

PostPosted: Mon Apr 03, 2017 1:13 pm
by Warpfield
It looks like this one was never really answered so, here goes.

If you recall, the Action event has three parameters:

public void ActionEvent(int EventNumber, object Argument, out int Cancel)

What you need to do is trap the ContentChanged event and cast the "Argument" object to BatchChanges. Then you can access the internal collections within the BatchChanges object. Shown below, we are casting the "Argument" object to a BatchChanges object then iterating through the DocumentsAdded collection:

Code: Select all
public void ActionEvent(int EventNumber, object Argument, out int Cancel)
{
    switch ((KfxOcxEvent)EventNumber)
    {
        case ((KfxOcxEvent)KfxOcxEvent.KfxOcxEventContentChanged):
            BatchChanges oChanges = (BatchChanges)Argument;
            foreach (Document oDoc in oChanges.DocumentsAdded)
            {
                // Do some stuff
            }
            break;
    }
}

Once you have casted the object properly, you should see several collections available in the intellisense list.