Skip to main content

Posts

We apologize for any inconvenience, but we've made the site read only while we're making some improvements

This message shows when I accidentally close my backup script of the SharePoint site. This massage is prompted by the SharePoint when  a site is in a maintenance mode. Resolutions Method 1 Go to the central administrator Application management –> Site Collection Quotas and Locks Select the site collection and change the locks information to Not Locked . Some times this page looks like disabled thus you need to try the method two. Method 2 $Admin = new- object Microsoft .SharePoint .Administration .SPSiteAdministration ('https: //www.site/sites/sitecollection') $Admin .ClearMaintenanceMode () This PowerShell Script changes the site collection back to normal.

How to initialize the SharePoint Client Context in SharePoint Apps (Provider Hosted / SharePoint Hosted) using JSOM (JavaScript Object Model)

  SharePoint Provider Hosted Apps First of all we need to understand the SharePoint Provider Hosted hosting blocks. Provider hosted involves two hosting domains (ex host, sphost ). thus request sending to host to sphost considering as cross domain request. For cross domain request we need to provide SPAppWebUrl to initialize the context. SPAppWebUrl  is available in Url. Ex:- https://host.azurewebsites.net/pages/default.aspx?SPHostUrl=https:%2F%2Fsphost.sharepoint.com%2Fsites%2app&SPLanguage=en-US&SPClientTag=0&SPProductNumber=16.0.3417.1223&SPAppWebUrl=https:%2F%2Fsphost-265535272e9c8d.sharepoint.com%2Fsites%2Fapp%2FSample&Source=https://app.azurewebsites.net/pages/default we can get AppWebUrl by accessing Url parameter. following shows a utility function for getting Url parameter. function getQueryStringParameter (paramToRetrieve) = { var params = document.URL.split( "?" )[1].split( "&" ); for ( var i = 0; i < para...

Working with SharePoint folder properties using CSOM (Client Side Object model ) in SharePoint 2013

  Accessing folder properties are but different from  SharePoint list item access. Following code demonstrates  the basics. Create SharePoint Folder with Properties using (var clientContext = ypurMethodToGetSpContectt() ) {   var lst = clientContext.Web.Lists.GetByTitle( "ListName" ); var folder = lst.RootFolder.Folders.Add( "FolderName" ); folder.Properties[ "property1" ] = "sample" ; folder.Properties[ "property1" ] = "sample" ;   folder.Update(); clientContext.ExecuteQuery();   }

SharePoint 2013 Licensing model

SharePoint 2013 licensing model has changed bit for user scenarios. it has been slightly change from the SharePoint 2010 server user licensing model. SharePoint Server should be license under two categories. Server License Client Access License (CAL) Server License Each SharePoint server in the farm should be license under SharePoint server license. Apart from the windows server licenses, SharePoint server should be licensed. This can be done when the time of installation of the SharePoint server. The SQL servers in the SharePoint farm should be installed according to the SQL server licensing model. Client Access License (CAL) After that SharePoint farm should hold licenses for client access. These licenses are reviewed in the audit process and does not require any key in activation. Depending on the user accessing organization requires to have CALs. Intranet and Extranet CAL requirements Assume organization setup a intranet and which is having users from internal AD , auth...

How to add/update SharePoint user field (person group column) using ECMA Scripts

  SharePoint app model supports enough capability to work with SharePoint from JavaScript. Working with Person Group column is a common task in SharePoint development. Following illustrates how to  update  a single and multiple values to  SharePoint person group column. Insert / Update Single Value SharePoint Person Group Column (People Field) Tip: For single value you should refer the person or group by ID var user = new SP.FieldUserValue(); user = 1; // this is the ID for User or Group in SharePoint listitem.set_item( "Column Name" , user); listitem.Update(); ctx.ExecuteQuery(); Insert / Update Multi Value SharePoint Person Group Column (People Field) Tip: For multiple users you need to refer it by login name var users =[];   users.push(SP.FieldUserValue.fromUser( "dev Members" )); // adding group users.push(SP.FieldUserValue.fromUser( "i:0#.f|membership|melick@oapp.onmicrosoft.com" )); // adding user   listitem.set_item( "Column Name...

Session on SharePoint App Architectural View

Audience: 20+

Programmatically Change Default Content Type in SharePoint 2013 List

  SharePoint list does not have any direct property or method to make content type default. but it is having content type ordering. thus making content type in first of the list automatically makes that content type default. following shows a sample code using (var site = new SPSite( "url" )) { using (var web = site.AllWebs[ "yourweb" ]) { var lst = web.Lists[ "Your List" ]; SPContentTypeCollection currentOrder = lst.ContentTypes;   // make default content type var newOrder = currentOrder.Cast<SPContentType>().Where(ct => ct.Name.Contains( "Content Type To Default" )).ToList(); lst.RootFolder.UniqueContentTypeOrder = newOrder; lst.RootFolder.Update(); } }