Unlink a copy of a file from it's source

Mar 16, 2011 at 10:29 PM

Hello !

First of all i have to say that you guys did a great job and i really appreciate the effort to accomplish this library, recently i heavenly used this library and i'm facing an issue regarding CopyIntoItemsLocal operation of the Copy Web Service,it seems to be that the coped document still pointing or linked to the original one so i have to go and click unlike for each file, since my intention is to move the file not copy it,so here is the question is there anyway to programmatically do this using JavaScript??

Thanks in advance ! :-)

Mar 17, 2011 at 10:47 AM

You might be able to do this by following a sequence of operations. First, copy the document as you already do and then try to delete the source document. If this does not work (I have not tried it yet), You might be able to again copy the item as you already do but then copy it a second time over itself by setting the source and destination url as the same thing. Again I have not tried it but it might work :)

Coordinator
Mar 17, 2011 at 12:24 PM
Dan:

Always up to your tricks! I believe I've tried 'em all. There's no direct way that I've ever found to sever the connection between the copies. To me, this is a deficiency in the Copy Web Service, but I think it's intended to do exactly what it does.

Your alternative is to use GetListItems and UpdateListItems to make a new item in the target list. Caveat: I've never tried to pursue this with documents.

M.
>
Mar 17, 2011 at 5:43 PM

I like tricks because sometimes they work!

I tried the copy over itself option and it did work. If I go to the item and look at the ECB it shows the "Go to Source Item" link which is now just a link back to the DispForm of the item itself!

Do I get a prize? (Just kidding on the prize!)