-
REST API Endpoint and JSOM Code to get the list of sub sites for the current user
While working with any SharePoint site, there might be a need to display the list of sub sites to which the current user has access, using JSOM or REST APIs. One might end up writing the below code for getting the list of sub sites for the current user. JSOM...
-
SharePoint JS CSOM code to create a subsite using a custom Site Template
Below is the code snippet to create a subsite in a SharePoint site collection using an existing custom site template. var webUrl = "newSubSite", webTitle = "New Sub Site", webDesc = "Description about the new web/site"; var siteTemplate; var CONST_PROJECT_TEMPLATE = "Custom Project Template"; var ctx = SP.ClientContext.get_current(); var webTemplates...
-
SharePoint JS CSOM Code to add/update Choices for a Choice Field
Following code snippet shows how to update the 'Status' column within a Tasks list and add new choice values to the field/column using JS CSOM. The Status column within a Tasks list is of type Choice Field. var CONST_TASKS_LIST_TITLE = "Tasks"; var CONST_TASKS_LIST_COLUMN = "Status"; var strStatusValues = "Deferred,Closed,Blocked,Postponed for...
-
SharePoint JSOM code to Hide/Remove Ribbon tabs in SharePoint List Forms or Pages
The Ribbon shows certain tabs like 'Edit', 'View', 'Items', 'List' etc., when we are on a list form page or when a List is added to any SharePoint page. In some cases we do not want to show these tabs to the users, which can be hidden by adding JSOM...