Checking if a SharePoint 2013 Page is Checked Out or Published with JavaScript and REST

There are two ways to check if a page is checked out. You can either use the checkOutType property of the SPFile object like in the example below:

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.spfile.spcheckouttype.aspx

Which lets you know if the state of the file’s checkout, but it does not tell you if the file is published. For this, we need to use a different property; the SPFile.Level (which is of type SPFileLevel):

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.spfilelevel.aspx

So an example of using this property to check if a page is published, might look something like:

 

 

 

 

 

Checking if a SharePoint 2013 Page is Checked Out or Published with JavaScript and REST
Tagged on:         

One thought on “Checking if a SharePoint 2013 Page is Checked Out or Published with JavaScript and REST

Leave a Reply

%d bloggers like this: