0

I have a business requirement of changing the date of 'created' column/field of selected document/s in a document library(it has to be changed to current system date). This has to be done by adding a custom button to the ribbon and providing authorization to the button. Please let me know if this is possible?

2

Yes, it should be possible. See this article as reference, and sample code here. In that sample a custom field was developed to achieve the same goal, but you can easily translate that into a ribbon component (button) as well.

yourFile.Item["Created"] = DateTime.Now;
yourFile.Item.UpdateOverwriteVersion();

The sample allows only site admins (Web.CurrentUser.IsSiteAdmin) to use the field.

See this related thread too.

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.