Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Search Error on FolderId
System
Hi
Can anyone help me with an example of searching on the FolderId (nrContainerId)? I get an error "Invalid parameter for request" when doing the search, I have no problem when using other attributes in the search, eg author or custom1. A sample I am using is below, the error is produced at the last line, when the search is performed. I am using v8.0.211.0 imanage.dll
Dim iDms As NRTDMS = New NRTDMS()
Dim iSession As NRTSession
Dim iDb As NRTDatabase
iSession = CType(iDms.Sessions.Add("imanage"), NRTSession)
iSession.Login("user", "password")
iDb = CType(iSession.Databases.Item("databaseX"), NRTDatabase)
Dim SearchParameters As NRTSearchParameters = iDms.CreateSearchParameters
SearchParameters.Add(AttributeID.nrContainerID, "143")
Dim Documents As NRTDocuments = iDb.SearchDocuments(SearchParameters, False)
'Same error with recursive option on or off
'Dim Documents As NRTDocuments = iDb.SearchDocuments(SearchParameters, False, False)
Find more posts tagged with
Comments
jny
I belive you need to pass in the folder.ID which is the moniker and not the folder.FolderID to the nrContainer param.
Migrateduser
Thanks jny. I tried that, it doesn't work either.
I have a workaround. There is another version of SearchDocuments which is available from the session (and takes an array of database names as an additional parameter). This version works. There must be a bug in the database-level version. I suspect that now the v8.0 objects are available they won't bother to fix these older ones. I just happen to be using an environment that doesn't support the newer objects - bummer.
jny
Actually, I presume you are searching within the folder -- not database. The containerID is for folder search.
For database, you should be able to use the SearchDocument call off of the database object. If you have more than one database to search, use the session or workarea search and passing the db names to the manstrings argument.
Migrateduser
Hi jny
You are right, I am searching for documents within a folder, and I am using SearchDocuments - see my original code snippet. The database version does not work, it returns an error. I would like to use this version, as I am only searching within one database, but I am forced to use the session version because of the error.
jny
I was able to do a search-within using the IMan Interfaces:
Dim oDMS As New ManDMS
Dim oSess As IManSession
Set oSess = oDMS.Sessions.Add("NTDEVSUPPORT")
oSess.TrustedLogin
' Get a folder for testing
Dim ofldr As IManDocumentFolder
Dim fparms As IManFolderSearchParameters
Dim oList As ManStrings
Set oList = New ManStrings
oList.Add oSess.Databases.ItemByIndex(2).Name
Set fparms = oDMS.CreateFolderSearchParameters
fparms.Add imFolderName, "1_FolderTest" ' arbitrary folder name.
Set ofldr = oSess.WorkArea.SearchFolders(oList, fparms).ItemByIndex(1)
Dim oParms As IManProfileSearchParameters
Dim oResults As IManDocuments
Set oParms = oDMS.CreateProfileSearchParameters
With oParms
.Add imProfileLastUser, oSess.UserID
.Add imProfileContainerID, ofldr.ObjectID
End With
Set oResults = oSess.Databases.ItemByName("DSS2").SearchDocuments(oParms, False)
jny
I also did not run into problems using the legacy interfaces:
Dim idms As New NRTDMS
Dim isess As NRTSession
Set isess = idms.Sessions.Add("NTDEVSUPPORT")
isess.TrustedLogin
Dim iparms As NRTSearchParameters
Dim iresults As NRTDocuments
Set iparms = idms.CreateSearchParameters
iparms.Add nrLastUser, isess.UserID
iparms.Add nrContainerID, "!nrtdms:0:!session:NTDEVSUPPORT:!database
SS2:!folder
rdinary,49:"
Set iresults = isess.Databases.Item("DSS2").SearchDocuments(iparms, True, False)
' This worked, too.
' Set iresults = isess.Databases.Item("DSS2").SearchDocuments(iparms, False, False)
Migrateduser
Hi jny
You are using the session version in your second example, the one I arrived at after many hours of fruitless messing around with the database version - see my original post with the code.
Migrateduser
Hi jny
Sorry, too quick to jump down your throat, I need to get some reading glasses.
What environment are you working in, and what dll version? I am having the same error in vb.net 2003 and coldfusion mx. imanage dll is version 8.0.211.0
jny
I'm using the release version of 8.1.1. and it has the imanage.dll v8.1.15.0.