Posts

Check current user exists in a group using an AJAX call

$.ajax({     url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getByName('Site Members')/Users?         $filter=Id eq " + _spPageContextInfo.userId,     type: "GET",     cache: true,     async: false,     headers:{         "ACCEPT": "application/json;odata=verbose"     },     success: function (data) {         if (data.d.results[0] != undefined) {         //user is a member         }     },     error: function () {     } });

SharePoint 2013 Cross-Site Publishing Overview

http://gowthamrajamanickam.blogspot.in/2015/03/sharepoint-2013-cross-site-publishingxsp_2.html 

Creating a Document Library in SharePoint hosted APP using SharePoint 2013 REST API

I used the below code to create a document library using SharePoint 2013 Hosted App Before you do this just copy the below code and paste it into APP.js file < script type ="text/javascript">              'use strict' ;               var hostweburl;                var appweburl;                   // This code runs when the DOM is ready and creates a context object which is                // needed to use the SharePoint object model               $(document).ready( function () {             ...

List of REST Access Points

List of REST Access Points Site http://server/site/_api/site   Web http://server/site/_api/web   User Profile http:// server/site/_api/SP.UserProfiles.PeopleManager   Search http:// server/site/_api/search   Publishing http:// server/site/_api/publishing List of REST End Points  The following is a list of end points that are the most commonly used on a SharePoint list. http://server/site/_api/web/lists http://server/site/_api/lists/getbytitle('listname') http://server/site/_api/web/lists(‘guid’) http://server/site/_api/web/lists/getbytitle(‘Title’)

Retrieve followed sites in SharePoint 2013 using REST API

Today i have faced one scenario that how to get all sites that i am following Use the below code to get the sites that current user following Steps to achieve this 1. Create a text file and paste the below code then upload that text file into any document library in site 2. Create a page and insert content editor WebPart 3. Link the text file in the content editor WebPart and save the page Code  < html >        < head >           < script type ="text/javascript" src ="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></ script >                  < script type ="text/javascript">              var followingManagerEndpoint;              var followedCount; ...

Update list item using LINQ

SPListItem resultItem = (from SPListItem oItem in oWeb.Lists["CustomList"].Items                          where Convert.ToString(oItem["ColumnName"]) == 'Value'                          select oItem).First(); resultItem["Title"] = "Sample"; resultItem.Update();

Get current logged in username using REST API

$.ajax({    url: _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=DisplayName",    type: "GET",    headers: {"accept": "application/json;odata=verbose"},    success: function (data) {       userName=data.d.DisplayName;    },    error: function (xhr) {       alert(xhr.status + ': ' + xhr.statusText);    } });