Answered by:
SPListItem.UpdateOverwriteVersion creates minor version?

Question
-
I have used this method but this creates minor version but msdn says that
"
This method updates the current list item without creating another version of the item."
I am updating modified filed ,filed is getting udpated but its creating new minor version.
Any way to prevent this from creating new minor version?
PS: I dont want to disable versioning on list and then enable it again..to complete the task
Monday, November 14, 2011 6:05 PM
Answers
-
Nilesh,
This is expected behaviour and you can not avoid minor version with this method without disabling minor versioning feature.
SystemUpdate() method should do the trick for you but by default these changes wouldn't be recognized by the crawler. If you want to prevent new versions and have the search crawler pick it up then you probably need to do a full crawl after you make these changes.
Refer following for more detail on suggested solutions:
http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/d0fbf1f2-489f-4ebf-8b21-260d55a49a0b
http://wss.boman.biz/Lists/Posts/Post.aspx?ID=45
Leonid Lyublinski Wizard of MOSS- Marked as answer by Nilesh Jain Tuesday, November 15, 2011 6:40 PM
Tuesday, November 15, 2011 4:33 PM
All replies
-
There is a 2007 and a 2010 version. The 2007 version has comments infering that this is broken: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.updateoverwriteversion(office.12).aspx
Here's the 2010 reference: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.updateoverwriteversion(office.12).aspx
Steve Clark, MCTS | Twin-Soft.com- Edited by SClark_EasyBins Tuesday, November 15, 2011 2:47 PM
Tuesday, November 15, 2011 2:46 PM -
Hi Nilesh,
Use SystemUpdate - Updates the database with changes made to the list item without changing the Modified or Modified By fields. (This includes versions etc..)
Reference http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.systemupdate.aspx
-Ivan
Ivan Sanders My LinkedIn Profile, My Blog, @iasanders.
- Edited by Ivan Sanders Tuesday, November 15, 2011 3:48 PM
Tuesday, November 15, 2011 3:47 PM -
Nilesh,
This is expected behaviour and you can not avoid minor version with this method without disabling minor versioning feature.
SystemUpdate() method should do the trick for you but by default these changes wouldn't be recognized by the crawler. If you want to prevent new versions and have the search crawler pick it up then you probably need to do a full crawl after you make these changes.
Refer following for more detail on suggested solutions:
http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/d0fbf1f2-489f-4ebf-8b21-260d55a49a0b
http://wss.boman.biz/Lists/Posts/Post.aspx?ID=45
Leonid Lyublinski Wizard of MOSS- Marked as answer by Nilesh Jain Tuesday, November 15, 2011 6:40 PM
Tuesday, November 15, 2011 4:33 PM