Not an object reference

Not an object reference

Postby twildt » Thu Oct 08, 2015 1:43 pm

I have this set:
Global Const INDEX_FLD_ACCT = "AccountNumber"

I am setting the field invalid like so:
MakeFieldInvalid(pXDoc.Fields.ItemByName(INDEX_FLD_ACCT), "Lookup did not find a result")

But I get the following error when compiling:
Not an object reference.

What gives?
twildt
Participant
 
Posts: 108
Joined: Tue Dec 17, 2013 2:09 pm

Re: Not an object reference

Postby russell@centuryc.com » Fri Oct 09, 2015 12:31 pm

twildt wrote:MakeFieldInvalid


I've not heard of that function. Where did you find it?

I doubt if it's part of the language itself, it would have to be part of the added libraries.

Oh, and I think you need to put the field name in quotes: MakeFieldInvalid(pXDoc.Fields.ItemByName("INDEX_FLD_ACCT"), "Lookup did not find a result")
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Not an object reference

Postby twildt » Fri Oct 16, 2015 5:32 am

I figured it out. My references were for a FolderField instead of a IndexField...

This is a simple Sub I created to mark a field either valid, or invalid.

Public Sub MakeFolderFieldInvalid(ByVal pFolderField As CscXFolderField, sMess As String)
pFolderField.Valid = True
pFolderField.ExtractionConfident = True
pFolderField.Confidence = 1
pFolderField.ErrorDescription = ""
twildt
Participant
 
Posts: 108
Joined: Tue Dec 17, 2013 2:09 pm

Re: Not an object reference

Postby russell@centuryc.com » Fri Oct 16, 2015 11:23 am

twildt wrote:Public Sub MakeFolderFieldInvalid(ByVal pFolderField As CscXFolderField, sMess As String)
pFolderField.Valid = True
pFolderField.ExtractionConfident = True
pFolderField.Confidence = 1
pFolderField.ErrorDescription = ""


Nice idea, but I think the logic is backwards - that will make a field valid.
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Not an object reference

Postby twildt » Fri Oct 16, 2015 1:01 pm

That's what I get for hand typing instead of copy paste...

Here is the code:

Code: Select all
Public Sub MakeFolderFieldValid(ByRef pFolderField As CscXFolderField)

   pFolderField.Valid = True
   pFolderField.ExtractionConfident = True
   pFolderField.Confidence = 1
   pFolderField.ErrorDescription = ""

End Sub

Public Sub MakeFolderFieldInvalid(ByVal pFolderField As CscXFolderField, sMess As String)

   pFolderField.Valid = False
   pFolderField.ExtractionConfident = False
   pFolderField.Confidence = 0
   pFolderField.ErrorDescription = sMess

End Sub
twildt
Participant
 
Posts: 108
Joined: Tue Dec 17, 2013 2:09 pm

Re: Not an object reference

Postby russell@centuryc.com » Mon Oct 19, 2015 3:24 pm

twildt wrote:That's what I get for hand typing instead of copy paste...


I figured it was something like that. :)
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA


Return to Kofax Transformation Modules General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests