Posts

Showing posts with the label Sharepoint 2013

SharePoint 2013 - Get list items using REST

Here I demonstrated how to fetch items of a SharePoint list using Rest. Example code for REST: //get the title of the site var siteUrl = _spPageContextInfo.webAbsoluteUrl; //Ajax call to get data $.ajax({ url: siteUrl + "/_api/web/lists/getbytitle('Give Title of List Name')/items" , method: "GET" , headers: { "Accept" : "application/json; odata=verbose" }, success: function (data) { var listitems = data.d.results; // listitems.forEach(function (entry) { // $('#message').text(listitems["FirstName"]); // }); }, error: function (data) { alert( "Error" ) } });

SharePoint Designer – Cannot display the item

Image
To resolve the following issue while opening an item in SharePoint Designer 2010 .You have to delete your cache: C:\Users\yourname\AppData\Roaming\Microsoft\SharePoint Designer\ProxyAssemblyCache

How to get SharePoint Groups using Javascript in SP2013 ?

<script type="text/javascript"> var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups";   var requestHeaders = { "accept" : "application/json;odata=verbose" };   $.ajax({     url : requestUri,     contentType : "application/json;odata=verbose",     headers : requestHeaders,     success : onSuccess,     error : onError   });   function onSuccess(data, request){ var s='';  for (var i = 0; i < data.d.results.length; i++) { s +=data.d.results[i].LoginName+'\n'; }     alert(s); }  function onError(error) {     alert("error");   } </script>

How to get List of SharePoint Groups to which Current Users belongs using Javascript ?

var userid= _spPageContextInfo.userId;   var requestUri = _spPageContextInfo.webAbsoluteUrl + '/_api/web/CurrentUser/Groups?$select=Id,Title'; alert(requestUri);   var requestHeaders = { "accept" : "application/json;odata=verbose" };   $.ajax({     url : requestUri,     contentType : "application/json;odata=verbose",     headers : requestHeaders,     success : onSuccess,     error : onError   });   function onSuccess(data, request){ var s='';  for (var i = 0; i < data.d.results.length; i++) { s +=data.d.results[i].Title+'\n'; }     alert(s); }   function onError(error) {     alert("error");   }

Connecting a sharepoint 2013 list to external database table

Image
I’ve done this plenty of times and never documented it, and one of these times I’m going to be working on something else, have to build one real quick, and forget how I did it, so i’m writing it down. You can have a SharePoint 2010 List that connects to an external database table and perform CRUD operations on it, and it’s not that difficult to do. There’s generally speaking 3 specific steps required. First, decide if you want to grant your users of this list database access individually or if you want to use the Secure Store Service in SharePoint. If you plan to grant users individual access to the database resources, just impersonate their credentials when building the External Content Type. In this example, we will use the Secure Store Service. Open a browser and navigate to your farm’s Central Administration site. Under Application Management, choose Manage Service Applications. Locate the Secure Store Service in the list and click the link to open. In the ribbon at the top