[left]Hi,
I'm using the SearchCmd to show the search dialog. I want to retreive the search criteria chosen by the user using the "SearchParameters" contextItem (as described in the manual).
However when i set the search parameter object to the contextItem i receive the following error:
[NRTSearchParameters][RemoveByAttribute]Item "Attribute" is not found
Any ideas why? Running Worksite 8.2
Code:
Public Function searchDocuments(ByVal lHwnd As Long, _
ByVal sUniqueID As String, _
ByVal bShowProfile As Boolean, _
ByVal sSearchfor As String, _
ByVal sSearchValues As String, _
ByVal iMaxRows As Integer, _
bOverflow As Boolean, _
sStatus As String) As Results
' search for documents
Dim oSearchCmd As Imanextlib.SearchCmd
Dim oSearchedNRTDocs As IManage.NRTDocuments
Dim oDocument As IManDocument
Dim oParams As IManProfileSearchParameters
Dim oArrSession(0) As IManage.NRTSession
Dim oContent As IManContents
'Dim oResults As DocumentResults
Dim sSparams() As String
Dim sSValues() As String
Dim oSearchParams As IManage.NRTSearchParameters
Dim oNRTDatabase(0) As String
Dim oNRTDMS As NRTDMS
Set oArrSession(0) = oWrkSession
oArrSession(0).MaxRowsForSearch = iMaxRows
Set oNRTDMS = oWorksiteDMS 'valid IMANDMS object cast to NRTDMS
'On Error Resume Next
Set oSearchCmd = New Imanextlib.SearchCmd
Set oWrkContextItems = New Imanextlib.ContextItems
With oWrkContextItems
' Populate the ContextItems collection with required values
.Add "ParentWindow", lHwnd
.Add "NRTDMS", oNRTDMS
.Add "SelectedNRTSessions", oArrSession
End With
With oSearchCmd
.Initialize oWrkContextItems
.Update
'if the command is active, it can be executed.
If .Status = _
(.Status And nrActiveCommand) Then
.Execute
bOverflow = oWrkContextItems.Item("varOverFlow") = "yes"
Set oSearchedNRTDocs = oWrkContextItems.Item("SearchedNRTDocuments")
'-------------------------------------------------------------------------------------------------------------
Set oSearchParams = oWrkContextItems.Item("SearchParameters") 'problem occurs
'--------------------------------------------------------------------------------------------------------------
End If
End With
Set oDocument = Nothing
Set oSearchCmd = Nothing
Set oWrkContextItems = Nothing
Set oSearchedNRTDocs = Nothing
Set oArrSession(0) = Nothing
Set oParams = Nothing
End Function[/left]