06-21-2016 02:30 PM
I have a VBScript which runs as a Custom Processing operation on documents in my scan queue. I am able to retrieve the BatchID and save it to a keyword but am having trouble getting the "Created By" property.
Here is the code:
' ######### Begin Variables #############
'--OnBase Variables
Dim obapp ' OnBase Application
Dim curdoc ' Current Document Object
Dim batchid ' Current Batch ID
Dim scanuser ' Name of the scan user
' ######## Begin Script #################
Sub Main35()
set obapp = CreateObject("onbase.application")
set curdoc = obapp.CurrentDocument
batchid = curdoc.Batch
call curdoc.Keywords.AddKeyword("Batch Number", batchid)
' ########### Stuck Here ###########
scanuser = ?????
' ########### Stuck Here ###########
call curdoc.Keywords.AddKeyword("User", scanuser)
curdoc.StoreKeywords
set curdoc = Nothing
set obapp = Nothing
End Sub
Can anyone help with how to get the scanuser value?
06-21-2016 02:52 PM
Hi Chris,
The CurrentDocument object of the automation API does not currently expose the user that created the document, so the only recourse I can think of in your script would be to use ADO to select it out of the database using the batch ID (because it sounds like you want the user that created the batch - not necessarily the user that is currently listed as the 'owner' of the document - that would be updated to the last person that indexed the document). So - if you want the creator, then use ADO to execute this:
"select u.username from hsi.useraccount u inner join hsi.archivedqueue a on u.usernum = a.usernum where a.batchnum = " & batchid
06-21-2016 02:52 PM
Hi Chris,
The CurrentDocument object of the automation API does not currently expose the user that created the document, so the only recourse I can think of in your script would be to use ADO to select it out of the database using the batch ID (because it sounds like you want the user that created the batch - not necessarily the user that is currently listed as the 'owner' of the document - that would be updated to the last person that indexed the document). So - if you want the creator, then use ADO to execute this:
"select u.username from hsi.useraccount u inner join hsi.archivedqueue a on u.usernum = a.usernum where a.batchnum = " & batchid
06-22-2016 04:56 AM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.