Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Constraining searches to released files

1 REPLY 1
Reply
Message 1 of 2
spparker0113
287 Views, 1 Reply

Constraining searches to released files

Hello, 

 

I'm just getting started with the SDK and examples, but am having trouble with returning only files in a released state through FindFilesBySearchConditions. I've tried the following, but am obviously missing something.

 

var condition0 = new SrchCond
{
    PropDefId = 8, //File Name
    SrchOper = 1, //Contains
    PropTyp = PropertySearchType.SingleProperty,
    SrchTxt = "002500"
};

var condition1 = new SrchCond
{
    PropDefId = 33, //Released Revision
    SrchOper = 3, //IsExactly
    PropTyp = PropertySearchType.SingleProperty,
    SrchRule = SearchRuleType.Must,
    SrchTxt = bool.TrueString
};

 

var conditions = new SrchCond[] {condition0, condition1};

 

I've also tried changing condition1 to:

 

var condition1 = new SrchCond
{
    PropDefId = 42, //State
    SrchOper = 3, //IsExactly
    PropTyp = PropertySearchType.SingleProperty,
    SrchRule = SearchRuleType.Must,
    SrchTxt = "Released"
};

 

Could someone steer me in the right direction? Just want to return released files. Thanks in advance...very much appreciated.

 

Sean

1 REPLY 1
Message 2 of 2
Redmond.D
in reply to: spparker0113

The code you have so far looks OK.  Try running the query manually through the Find dialog.  If you get no results through the UI, then you know it's a problem with the search criteria.

 

If you are still having code issues, post your call to FindFilesBySearchConditions, and I'll take a look.



Doug Redmond
Software Engineer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report