Article archive

Author field in Discussion List not found

09/02/2016 08:51
In one of our project we needed to customize Discussion List of Community site.   When calling obvious code with item["Author"], we got exception Value doesn't fall in expected range  In UI, field was there, had value, we can read it in PowerShell, but unable to read it in code inside...

Set SharePoint Timer Job Progress

09/02/2016 08:41
use e. g. following code in Execute(...) method   int i=0   int loginsCount = logins.Count;   foreach(... in logins)   {    ...    i++;    int progress = Convert.ToInt32(Math.Ceiling((double)i / (double)loginsCount * 100));   ...

Query User Field

04/02/2016 08:05
Add-PSSnapin microsoft.sharepoint.powershell -ea 0 $webUrl = "https://yoursitecollection" $listUrl = "/Lists/Members" $memberId = 27 #'Member' field is of type SPUser $web = Get-SPWeb $webUrl $listUrl = $web.ServerRelativeUrl + $listUrl $list = $web.GetList($listUrl); $list.Title $query = New-Object...

Get list by url

03/02/2016 02:07
//e. g. listUrl is '/Lists/Announcements' or library '/Shared Documents' public static SPList GetListByUrl(SPWeb web, string listUrl) {  string listRelativeUrl = SPUrlUtility.CombineUrl(web.ServerRelativeUrl, listUrl);  try  {   SPList list =...

Set SharePoint group description programmatically

29/01/2016 03:06
SPGroup object has Description property, but when we change that, it's not visible in group view. There is another column named 'About me' and your first description is displayed there. But after changig Description property, About me remains the same. To change About me text we need to update...

Call C# Web method by JavaScript

29/01/2016 02:54
In this partial example we are going to use page web methods to be called by JavaScript. We create model, logic in .Net, and we use JavaScript just to display model data, errors... We have SharePoint application page and in its code behind we have defined web methods.Then we have javascript file...

Add context menu to list item field by powershell

05/01/2016 01:18
List item context menu is bound to SharePoint 'Title' field by default. However, sometimes we don't have this field in our content type or we have the other reason to have context menu on the other field. Here is the powershell script, how to bind context menu to the other...

Get spelling error count using SharePoint SpellCheck

28/12/2015 08:14
//reads 'inputString' and returns spelling error count //script is using SharePoint Spell Service (SpellCheck.asmx) in vti_bin function getSpellCheckErrorsCount(inputString) {     var errorCount;  var lcid = SP.Res.lcid; //e. g. En-Us is 1033  var serviceUrl =...

MSDN link for JavaScript Object Model - JSOM

18/12/2015 01:39
Code examples, how to work with basic SharePoint entities using JSOM. https://msdn.microsoft.com/en-us/library/office/hh185015(v=office.14).aspx

Show Create view link and Edit view for SharePoint Surveys

17/12/2015 08:23
Attaching this script e. g. to master page, we add by javascript CSOM links to create view and edit views for SharePoint surveys to Survey Settings page.   var MyJSNamespace = {     showSurveyCreateViewLink: function () {         var currentUrl...
Items: 41 - 50 of 384
<< 3 | 4 | 5 | 6 | 7 >>