cancel
Showing results for 
Search instead for 
Did you mean: 

Post-Index Keyword Validation With VB Script Hook

Davin_Studer
Champ in-the-making
Champ in-the-making

I'm trying to validate the input on one of our keywords in our documents. Specifically, it is a date keyword named "Date of Service". I want to make sure that no future dates are put in. Below is my script. When fill in the keywords and click the index button I get the below error. Any thoughts on what I am doing wrong? They would be much appreciated. Thanks!

Error:
Error in script [107]
Error #424: Object required: 'keyPanel'
Line: 6
Source: Microsoft VBScript runtime error

Script:

Dim app, keyPanel, keys, i, bUpdatedSet app = CreateObject("onbase.application")Set keyPanel = App.IndexKeywordPanelSet keys = keyPanel.KeywordsbUpdated = falseFor i = 0 to keys.Count - 1	Select Case keys.Item(i).Name		Case "Date of Service"			If keys.Item(i).Value <> "" and CDate(keys.Item(i).Value) > Date Then				keys.Item(i).Value = ""				keyPanel.UpdateKeywords				bUpdated = true			End If	End SelectNextIf bUpdated Then	app.ExecutionStatus = 101End IfSet keys = NothingSet keyPanel = NothingSet app = Nothing
1 REPLY 1

Davin_Studer
Champ in-the-making
Champ in-the-making

Ok. I figured it out. I was using the "Scan Queue - Post-Index" in stead of "Scan Queue - Post-Index/Keyword Panel Hook" hook. It works now.