Posts

Showing posts with the label SharePoint 2013 Apps

SharePoint 2013 Apps: Get list of site collections using REST API

Image
Let me clear that it is not possible to fetch a list of site collection neither via REST nor by using JSOM. But there is a workaround i.e. by utilizing SharePoint Search Query REST/JSOM API. For that a basic search site collection should already be configured and crawled. Then in our code, we only need to specify the query contentclass:sts_site to return sites results. Following is the working code snippet that I used to achieve that: function GetAllSiteCollectionsInCurrentWebApp(currentUser) { var queryText = 'contentclass:sts_site'; var url = _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='" + queryText + "'"; var executor = new SP.RequestExecutor(_spPageContextInfo.webAbsoluteUrl); executor.executeAsync({ url: url, method: "GET", headers: { "Accept": "application/json;odata=verbose" }, success: function (data) { //RetrieveSiteColl...

SharePont 2013: Configuring/Preparing Your SharePoint 2013 Dev Environment for (SharePoint Hosted) App Development

This blog post is not intended to give an A to Z instruction set on how to set up an SharePoint 2013 Environment for SharePoint hosted app development. Since there has been a lot written on this subject.  This post will simply point out the issues and direct the readers towards the right article that explain the solution to the problem.  Following is a brief summary on how to prepare you SharePoint 2013 farm for app development. If you try creating an app using Farm Admin account you will get the following error: "Error occurred in deployment step "Installed app for SharePoint": The System Account cannot perform this action". This error is well justified because if you are using your farm account to develop SharePoint 2013 apps, this is definitly going to kill the purpose of creating Apps on this amazing App Model which is there to replace the Sandbox Model.  Therefore you got to be a Normal Dev user and you got to be in a separate domain and ...