Posts

Showing posts with the label sharepoint 2013

Set Logged in User As Default value in People Picker Field SharePoint 2013

function setLoggedinUser() {         var currentUser;         if (SP.ClientContext != null) {             SP.SOD.executeOrDelayUntilScriptLoaded(getCurrentUser, 'SP.js');         }         else {             SP.SOD.executeFunc('sp.js', null, getCurrentUser);         }         function getCurrentUser() {             var context = new SP.ClientContext.get_current();             var web = context.get_web();             currentUser = web.get_currentUser();             context.load(currentUser);             context.executeQueryAsync(onSuccessMethod, onRequestFail);         }         function onSuccessMethod(se...

Get List Items Using Rest API Sharepoint 2013

function getItems(url, callback) {     $.ajax({         url: _spPageContextInfo.webAbsoluteUrl + url,         type: "GET",         headers: {             "accept": "application/json;odata=verbose",         },         success: function(data) {             callback(data.d.results);         },         error: function(error) {             alert(JSON.stringify(error));         }     }); }

Get Logged In user FirstName and Last Name Properties Using REST API Sharepoint 2013

/****************Get FirstNaem LastName ****************/ function GetUserProperties(callback) {     $.ajax({         url: _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties/UserProfileProperties",         headers: {             Accept: "application/json;odata=verbose"         },         async: false,         success: function(data) {             callback(data);         },         error: function(jQxhr, errorCode, errorThrown) {             alert(errorThrown);         }     }); }

cmd for list wps runnning in sharepoint 2013

Image