How to get Checkin button while in the "Edit" form for document library in Sharepoint 2007
I had a customer requirement where he wanted to add a check-in button on the Edit form of a document library.
So that as soon as the required metadata is added to the item, the user can select to check-in the document instead of first clicking the OK button to save and then going back to doc-lib and checkin the document. They basically wanted to avoid the 2 step process, so they want the Checkin operation (as a button) on the edit-form itself.
The simple solution I found was If we add a query string to the end of the edit URL, it will show a check-in button. Something like:
https://server/Documents/Forms/EditForm.aspx?ID=xx&Mode=Upload
So I wrote a simple feature to add this as additional "Edit and Checkin" menu to ECB.
The elements file looks like this:
Following is the only important part of that feature (elements.xml file):
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="https://schemas.microsoft.com/sharepoint/">
<CustomAction Id="EditAndCheckin"
RegistrationType="List"
RegistrationId="101"
Location="EditControlBlock"
Sequence="2454"
Title="Edit-Properties and Check-In"
Description="Edit the properties and checkin">
<UrlAction Url="javascript:function process(){var str = location.href;str= str.substr(0,str.lastIndexOf('/'));var site='{SiteUrl}';var item={ItemId};window.location.href=str +'/EditForm.aspx?ID='+item+'&Mode=Upload';};process();"/>
</CustomAction>
</Elements>
Comments
Anonymous
March 21, 2011
I've tried this with MOSS 2010, but with no luck. Any ideas?Anonymous
May 17, 2011
Also doesn't work in Foundation 2010Anonymous
February 06, 2012
Article is really helpful. small trick has really worked well.