Forum Discussion
Zahar_Chernov
9 years agoCreator II
To search document:
Item docItem = inn.applyAML("<AML> <Item action='get' type='Document'> <item_number>{DOCUMENT_NUMBER}</item_number> <Relationships> <Item action='get' type='Document File' /> </Relationships> </Item> </AML>");to each document can be linked one or more files, so you need to loop the result and "checkout" the file
Item files = docItem.getItemsByXPath( "/Item[@type='File']" ); int fcount = files.getItemCount(); for( int i = 0; i < fcount; i++ ) { Item file = files.getItemByIndex( i ); Item result = file.checkout( "c:\\temp" ); if( result.isError() ) { Console.WriteLine( string.Format( "Failed to checkout file '{0}'", file.getProperty( "filename" ) ) ); } }