mercredi 28 janvier 2015

Document Migration: Is it possible to update Major Version document metadata fields, Author, Editor, Created and Modified



I have a library where version is enabled, both for Major and Minor versions. And I am importing documents to this library that has a lot of metadata I need to set including the internal fields Author, Editor, Created and Modified. It is working fine for updating documents that are minor version, I use the SPListItem.UpdateOverwriteVersion() after settings the Author, Editor, created and Modified fields after i have checked-in the document with a minor version. And this works fine.


My problem is this approach does not work for Major version documents, then Modified by is set to the account I am currently using to import the documents. If I try to run the SPListItem.UpdateOverwriteVersion() command a new minor version is created after the major version.


Is there anyway to update Major version documents in a library to set the Author, Editor, Created and Modified fields without creating a new minor version?


Edit: Found the solution that works and it is below.








0 commentaires:

Enregistrer un commentaire