Code Document Delete Event

Code Document Delete Event

Postby informationarchitects » Thu Aug 24, 2006 1:52 am

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.
informationarchitects
Participant
 
Posts: 4
Joined: Thu Aug 24, 2006 12:08 am

Post Elaborated

Postby informationarchitects » Thu Aug 24, 2006 2:50 am

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 :?: :?: :?: :?:
informationarchitects
Participant
 
Posts: 4
Joined: Thu Aug 24, 2006 12:08 am

Re: Code Document Delete Event

Postby Warpfield » Mon Apr 03, 2017 1:13 pm

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.
If they are going to hate you anyway for what you do, then you might as well put forth your best effort.
User avatar
Warpfield
Participant
 
Posts: 61
Joined: Tue Apr 10, 2007 8:11 am


Return to Custom Modules General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests