AnsweredAssumed Answered

WPDM API - Search for "IsNotEmpty"

Question asked by Sascha Smolny on Oct 6, 2015

Hello,

 

i am trying to search in the vault via API (VB.net) with the condition "IsNotEmpty". But i cant get it to work

 

Dim con As PDMWorks.PDMWConnection 
Dim Options As PDMWorks.IPDMWSearchOptions 
Dim results As PDMWorks.IPDMWSearchResults 

con = CreateObject("PDMWorks.PDMWConnection") 
con.Login("pdmwadmin", "pdmwadmin", "hmtechv") 
Options = con.GetSearchOptionsObject 
Options.IgnoreCase = True 
Options.IgnoreLinks = False 
Options.SearchConfigSpecificProperties = False 
Options.IncludeHiddenDocuments = True 
Options.SearchOnlyChildrenOf = "" 
Options.SearchCriteria.AddCriteria(PDMWorks.PDMWAndOr.pdmwAnd, PDMWorks.PDMWPropertyType.pdmwNumber, "", PDMWorks.PDMWConditionType.pdmwIsNotEmpty, "") 
results = con.Search(Options) 

MsgBox(results.Count) 
con.Logout()

I get no result.

 

If i change the search criteria to (with Value = "-")

Options.SearchCriteria.AddCriteria(PDMWorks.PDMWAndOr.pdmwAnd, PDMWorks.PDMWPropertyType.pdmwNumber, "", PDMWorks.PDMWConditionType.pdmwIsNotEmpty, "-")

I get after a long search (much longer than in SolidWorks...about 5 minutes) a result of many documents (much more than in SolidWorks). The results contains also dicuments with empty Number property.

 

What i am doing wrong?

 

Regards

Outcomes