Forum Discussion
16 Replies
- Zahar_ChernovCreator IITo 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 fileItem 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" ) ) ); } }
- Zahar_ChernovCreator IIPlease check Aras Online help for DOT.NET www.aras.com/.../R_Project_Innovator-_NET-API-Reference.htm
- Former_MemberAccelerator IIIOk that is fine. But where can i store the result of the search? and if i'am searching for a real document that exists in the database, how can i display his number and properties? Thank you. cordially.
- Zahar_ChernovCreator III think your questions are implementation questions - and not related to Aras. You need to create an interface to allow users to input they search criteria. After that you need to query the db based on user input (my previous answer)and then checkout the file. Then you need to save the data from Aras to document properties, so you will be able to upload the file back to the server. Creating integration between PLM (or other DB centric systems) with Office is not an easy task for beginner. You need to create interface and be able download and upload files. Check videos of this Aras Office Integration or this Office Integration by Aras partner XPLM or this Office Integration by MinveraPLM (Aras partner)
- Former_MemberAccelerator IIIHello, I have executed the code writen by you: 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>”); 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” ) ) ); } } with a real document name exists in my database. But i don't have any results ( no Failed to checkout file And no files downloaded in the temp folder) Should I create the folder "temp" or he will be created automatically? thank you very much
- Former_MemberAccelerator IIIthe variable "fcount" returns 0 despite of i am sure that i have two files(.doc and .pdf) in the DB who are in relationship with the document. for the search with "Item docItemm = inn.applyAML" i have done: Console.WriteLine(docItem); to see the result of search and i noticed that there is a mistake in the XML returned by the "docItemm ". So in the result i see: <thumbnail>vault:///?fileId=9429CCD4280644C0966893B14F45A671</thumbnail> But the vault:///?fileId=9429CCD4280644C0966893B14F45A671 should be between the symbole "" . What should i do? And thanks a lot!!