Wednesday, February 11, 2009

SharePoint Content Approval Status updating programmatically

SharePoint document libraries and list comes with the option to enable content approval. Using this out of the box option users who can view draft list items and documents can be controled easily. When enabling this option in document library and list internally a column is created. However this column cannot be accessed in the Customize settings page. For those who needs to update this field programmatically you can do so by using the example provided below:

SPModerationInformation ApprovalStatus = item.ModerationInformation;

ApprovalStatus.Status = SPModerationStatusType.Approved;

item.Update();



There are 5 options which you can choose from.

6 comments:

Aroh Shukla said...

thanks dude, ..i needed it desparately ...

Savan Dounde said...

thanks....it helped me a lot

Nikhil Doomra said...

Thanks a lot dude...

WaterLo said...

Thanks very much!

Սելին Սարգսեան said...

Thanks a lot :)
Great Post :)

Inheritx Solutions said...

This is nice and informative post, Thanks to post.

Sharepoint Development | Sharepoint Developers