How to check whether the scheduling page feature is enabled in SPFx
In my current project, I have to find out if the "Schedule" feature for communication pages is turned on. Honestly, I'm not sure if my method, which I'm sharing here, is the correct or supported way because I haven't seen any other methods online. If you know a better way or if my method is wrong, please leave a comment.
As you know, you have the property this.context.pageContext
in SPFx. You also know the legacyContext
property in the pageContext
object. The name might be scary and probably many do not use this property because of the name. But there is a lot of information right there. And whether certain features are activated or not, among other things.
However, if you want to know whether the Scheduling Feature is activated or not, you can check this as follows:
this.context.pageContext.legacyPageContext.featureInfo.SitePagesScheduling.Enabled
BTW: The featureInfo
contains a lot more information about other features
Happy Coding ;)
Subscribe to my newsletter
Read articles from $€®¥09@ directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
$€®¥09@
$€®¥09@
I am Sergej and I am a Software Architect from Germany (AURUM GmbH). I have been developing on Microsoft technologies for more than 14 years, especially in SharePoint / Microsoft 365. With this blog, I want to share my knowledge with you and also improve my English skills. The posts are not only about SPFx (SharePoint Framework) but also about tips & tricks around the M365 world & developments of all kinds. The posts are about TypeScript, C#, Node.js, Vue.js, Visual Studio/ VS Code, Quasar, PowerShell, and much more. I hope you will find some interesting posts. I would also be happy if you follow me. Greetings from Germany Sergej / $€®¥09@