Search Folder for Category Attribute Value
I'm trying to search through folders that may have a category attribute with a particular value. In my current test environment I have a folder on the Enterprise Level which has a Category called CASE that has an attribute called DOCKET ID containing a value fo 2323. I'm going through some sample search code that OpenText sent me but I'm not sure if I'm doing something wrong here or not. Each time the query goes through it comes back with no records returned.any feedback would be appreicated.thanks BradMy Code: Dim Search As String Dim vSelectList As Long Dim vQueryResults As Long Dim value As Long Dim Name As String Dim length As Long Dim i As Integer Dim rname As String Dim objid As Long Dim status As Long Dim session As Long Dim buf As String * 40 Dim outSize As Long Dim ltmp1 As Long status = LL_Initialize(LL_HEADER_VERSION)status = LL_SessionAlloc(lSession, sLiveLinkServer, sLiveLinkPort, sLiveLinkConnection, "****", "XXXXX")LL_ValueAlloc ltmp1status = LL_AccessEnterpriseWS(lSession, ltmp1)Dim ParentId As LongDim ParentVol As LongDim obj As LongLL_ValueAlloc objstatus = LL_AssocGetInteger(ltmp1, "ID", ParentId)'-------------------------------------------If status <> 0 ThenmodLiveLinkCommon.ConvertStatusToString statusEnd If'------------------------------------------- status = LL_AssocGetInteger(ltmp1, "VolumeID", ParentVol)'-------------------------------------------If status <> 0 ThenmodLiveLinkCommon.ConvertStatusToString statusEnd If'-------------------------------------------Debug.Print ParentId & " " & ParentVol & " Enterprise" 'Allocate Value objects If (LL_ValueAlloc(vSelectList) <> LL_OK) Then Debug.Print "Allocate(vSelectList) failed." Exit Sub End If If (LL_ValueAlloc(vQueryResults) <> LL_OK) Then Debug.Print "Allocate(vQueryResults) failed." Exit Sub End If If (LL_ValueAlloc(value) <> LL_OK) Then Debug.Print "Allocate(value) failed." Exit Sub End If 'Search = "(Attr_4589_2 : ""2323"")" 'Search = "2323" Search = "(""Docket ID"": ""2323"")" 'Add Fields to the Select List status = LL_ValueSetList(vSelectList) status = LL_ValueSetLength(vSelectList, 9) status = LL_ListSetString(vSelectList, 0, "OTName") status = LL_ListSetString(vSelectList, 1, "DataID") status = LL_ListSetString(vSelectList, 2, "OTData") status = LL_ListSetString(vSelectList, 3, "OTMimeType") status = LL_ListSetString(vSelectList, 4, "OTObject") status = LL_ListSetString(vSelectList, 5, "OTSubType") status = LL_ListSetString(vSelectList, 6, "OTCreatedByName")'I added this fields to see if they would make any difference. status = LL_ListSetString(vSelectList, 7, "Docket ID") status = LL_ListSetString(vSelectList, 8, "Attr_4589_2") status = LL_ValueSetTable(vQueryResults, vSelectList) 'Add List to the RecArray 'Search and print results in the form If (status <> LL_OK) Then MsgBox ("Error setting List") Else 'MsgBox ("Starting Search") 'ParentId 'Status = LL_ApplyQuery(lSession, objid, vSelectList, Search, LL_SORTBYDEFAULT, "", 0, 10, "LivelinkQueryLanguage", vQueryResults) status = LL_ApplyQuery(lSession, ParentId, vSelectList, Search, LL_SORTBYDEFAULT, "", 0, 10, "LivelinkQueryLanguage", vQueryResults) If (status = LL_OK) Then status = LL_ValueGetLength(vQueryResults, length) If (length > 0) Then MsgBox ("Search returned " & length & " Results") For i = 0 To length - 1 status = LL_ListGetValue(vQueryResults, i, value) status = LL_AssocGetString(value, "OTName", buf, 40, outSize) Name = Left(buf, outSize) Debug.Print Name Next Else MsgBox ("No Results were found") End If Else MsgBox modLiveLinkCommon.ConvertStatusToString(status) MsgBox ("Error Searching") Call Error End If End If LL_ValueFree (vSelectList) LL_ValueFree (vQueryResults) LL_ValueFree (value)