I have a library in SharePoint where I am uploading company documents. The titles of the documents have version numbers in them already. So would like to create a column in the library that will indicate whether or not a particular document is the latest version by indicating 'yes' or 'no'.
Asked
Active
Viewed 37 times
0
-
Welcome to Stack Overflow! You can take the [tour](http://stackoverflow.com/tour) first and learn [How to Ask a good question](http://stackoverflow.com/help/how-to-ask) and create a [Minimal, Complete, and Verifiable](http://stackoverflow.com/help/mcve) example. It will be easier for us to help you. – MrLeeh Jan 03 '17 at 15:14
1 Answers
0
You would need to write a piece of code such as a timer job to iterate all the items in the list and some logic to
- Get all versions of the document (Easy if you have a document naming convention)
- Check if the current item has the highest version number in the naming format
- Update your field to say yes or no.
Personally in your situation I would upload only the latest versions to the SharePoint document library removing the version number from the title and make it clear to your users these are the latest version, use something like date modified to justify this and make wherever the previous versions are read only in case someone needs to go and read one. I understand date modified may not be the perfect match but it's possibly the best you have in this situation.
Cheers
Truez

Truezplaya
- 1,315
- 1
- 13
- 26
-
-
And just one more thing. Where do I write the code? Can it be done in workflow? – lungu Jan 04 '17 at 09:06
-
Hi Lungu, I assume you are getting this field so you can then delete the ones that are not the most recent? If so I would powershell it as it's a one time run script, after that the SharePoint versioning should take over – Truezplaya Jan 04 '17 at 15:56