Quantcast
Channel: aras PLM community
Viewing all articles
Browse latest Browse all 1103

How to create a new version of a document using c#?

$
0
0

Hello,

I wrote a clientside program tho download a file of a document using c# . After editing the file I want to load it up again, but in a new version.

 

I' using the well known methods

Item fileToAttach = MyInnovator.newItem("File", "add");
            fileToAttach.setProperty("filename", name);
            fileToAttach.attachPhysicalFile(filepath);
            fileToAttach.apply();

Item doc_file = MyInnovator.newItem("Document File", "add");
            doc_file.setProperty("related_id", file.getID());
            doc_file.setProperty("source_id", doc.getID());
            doc_file.apply();
            doc.lockItem();
            doc.addRelationship(doc_file);
            doc.apply();
            doc.unlockItem();

This works. But no new version is created.

Ho can I do this?

I already reat the topic

4.2 Built in Action Methods

of the programmers guide, but I dont know how to deal with it.

Can anybody please give me a short example to operate with a new verion of a document (Item)?

 

Any help would be appreciated.

 

 


Viewing all articles
Browse latest Browse all 1103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>