Posted Mon, 02 Nov 2020 14:55:56 GMT by Nathan Wilkins
Good Afternoon,

I am looking for a method of clipping documents from a location to attach documents that already existing in the DocuWare File Cabinet using the DocuWare Platform API.

The files from the other location can be exported via an already built API directly to a Windows Explorer folder dumping the documents out for another API to push them into DocuWare.

For example, I have a document in a DocuWare File Cabinet with DOCID = 100.
I would like to clip 5 files (.PDF, .JPG etc) directly to that specific DOCID.

The document in the File Cabinet has 2 pieces of Unique Data, one of course being the Document ID but there is also another field "Reference Number" for example that will also be unique.

Does anybody have any examples of Clipping documents to existing documents in a Docuware File Cabinet at all?

Thank you.

Kind Regards,
Posted Mon, 02 Nov 2020 14:56:56 GMT by Matthias Wieland DocuWare Europe GmbH Sr. Director Support EMEA
Dear Nathan Wilkins! It looks like the Community cannot answer your question. That's why we have opened a Support Request with the Number SR-137990-Q3T6Y for you. A Software Support Specialist will contact you directly to follow up. We will update this thread with the solution as soon as we have resolved the Support Request. With best regards, DocuWare Support Team
Posted Thu, 12 Nov 2020 07:40:18 GMT by Leopold Pohlmann DocuWare Europe GmbH Specialist Software Support Team GREEN EMEA
Solution of the Support request:

Following example code, shows how to clip a new document to a existing document in a file cabinet. The docid was used to fetch the documents. This procedure can be advanced to an unlimited amount of documents, by using a loop.
        public static void ClipDocuments()
        {
            // Get id of existing document from filecabinet
            FileCabinet fc = organization.GetFileCabinetsFromFilecabinetsRelation().FileCabinet.First(f => f.Id == fcid);
            int doc1 = fc.GetDocumentsResult().Items.First(d => d.Id == docid).Id;
            // Upload second doc and fetch docid
            int doc2 = EasyUploadToFileCabinet(fc);
            // ClipDocuments documents
            List<int> docids = new List<int>()
            {
                doc1,
                doc2,
            };
            Document mergedDocument = fc.PutToContentMergeOperationRelationForDocument
                (
                    new ContentMergeOperationInfo()
                    {
                        Documents = docids,
                        Operation = ContentMergeOperation.Clip,
                        Force = true,
                    }
                );
        }
        private static int EasyUploadToFileCabinet(FileCabinet fc)
        {
            var document = fc.EasyUploadSingleDocument(
                new System.IO.FileInfo("C:/example.pdf"));
            return document.Id;
        }

You must be signed in to post in this forum.