Which function is called when you click on the "Check In" button of a page? I am referring to the button that opens the following modal dialog window.

Check In Page

It does not reference a page (already checked it with fiddler).


The function that Howard specified will have the following result:

Check In Page with version settings

If you want to try it out, here is the code:

var ctx = new SP.ClientContext.get_current()
var str=ctx.get_url()+"/_layouts/checkin.aspx?"+"List=Pages&FileName="+document.location;
OpenPopUpPage(str, CheckInNotifyAndRefreshPage);  

2 Answers 2


When you click Check In button, method handleCommand called from javascript object SP.Ribbon.PageState.PageStateHandler (sp.ribbon.js) with commandId = "PageStateGroupCheckin"
If you debug it, you can find that it executes this line at least:

return SP.Ribbon.PageState.Handlers.showStateChangeDialog(properties['CommandValueId'], SP.Ribbon.PageState.ImportedNativeData.CommandHandlers[properties['CommandValueId']]);  

Ok, somebody down voted, I'll explain how to find this function.
First of all inspect check in button using firebug or google chrome dev tools. Check in button is a link with id Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu.Checkout.Checkin-Menu16. Next, go to cmdui.xml file in 14 hive. Here using search find button with id Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu.Checkout. You will find this menu:

<Menu Id="Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu">  

and button with definition:

  Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-104" Image16by16Left="-32"
  Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-416" Image32by32Left="-192"

We interested in CommandValueId attribute. Next go to sp.ribbon.debug.js and using search find object, which handle this particular commandid - this is SP.Ribbon.PageState.PageStateHandler. All commands in page component handle method handleCommand, setup break and click check in in browser - consider screen shot below:


if you step further you got to line, that I mentioned above: img

It means, that when you press Check In in the ribbon method SP.Ribbon.PageState.Handlers.showStateChangeDialog fires.
Hope this helps.

  • Please, comment why down vote? Commented Jan 18, 2012 at 19:24
  • Valid answer to me, had enough detail even before you elaborated. +1 from me.
    – James Love
    Commented Jan 18, 2012 at 20:11
  • Thank you, it works! Now I see what I was been doing wrong. Commented Jan 18, 2012 at 21:18
  • When I try to call SP.Ribbon.PageState.Handlers.showStateChangeDialog in SharePoint 2013 I get following error: "Unable to get property 'CommandHandlers' of undefined or null reference". Commented Oct 31, 2014 at 14:35

I think it's the CheckInSingleItem function which can be found in \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\INPLVIEW.js

  • Thank you for your comment, but this does not open the correct check in page. This opens the one with the check in versions. Commented Jan 18, 2012 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.