0

How do i set a file existing in a library as a new version of another file in an event receiver?

E.g : i have two files in my SP library named "File.doc" and "File.pdf". I want the File.pdf to become the new version of the.doc one. and so, in my view i can only see the File.pdf, but no more File.doc. The File.doc will be in the list of old versions of File.pdf

  • Have you tried copying the file via REST (overwrite) and then delete the former file? – Dave Mar 14 '17 at 8:33
0

I am afraid this will not work as you hope. As you correctly said you have two files and for SharePoint they are two.

If you transform the .doc into a .pdf and try to save it, it would automatically become a new file.

One way to achieve what you want is to add a column to mark the .doc as "old" and a lookup column to link the .doc to the .pdf. Then get some fancy Views and your good.

0

Can you not just create a view set to show all File names that contain .pdf and another for .doc, then you can swap between the 2 if needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.