Article archive
Calendar view is missing in View selector
10/06/2016 15:50
If we create SharePoint list calendar view programmatically, there is an issue, this view disappears from view selector in list web part. There is manual step needed to enable/disable View selector in web part properties. Here is a script to do it programmatically by PowerShell (code in C# is...
Get list item url for document
06/05/2016 11:42
In document library, Common Worfklow data as Item URL sometimes returns bullshit strings as https://sever/sites/siteUrl/_layouts/15/WopiFrame.aspx?sourcedoc=/sites/siteUrl/Shared%20Documents/MyExcelFile.xlsx&action=default&OpenIn=browser or others in case of SharePoint listinstead of...
Remove web property from SharePoint
16/03/2016 11:22
Seems like a trivial task, but there was a problem that sometimes property wasn't removed. Here is the method, how to update correct objectspublic static void RemoveWebProperty(SPWeb web, string webPropertyName){ if...
Enable Rating Settings on SharePoint list programmatically
15/03/2016 16:21
public static void EnableRatingOnList(SPList list){ Assembly assembly = Assembly.Load("Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"); Type reputationHelper =...
Check if SharePoint item is followed programmatically
25/02/2016 11:56
Function bellow checks if SharePoint document is followed by user. Code to follow/unfollow document is at link Follow SharePoint document programmaticallypublic static bool IsItemFollowed(SPWeb web, SPUser user, string listUrl, int itemId){ bool isFollowed =...
Follow SharePoint document programmatically
25/02/2016 11:46
Function bellow sets 'Follow' for document with 'itemId' within sharepoint list at 'listUrl' for user 'user'. Setting HttpContext to null is because of error: The operation failed because an internal error occurred. Internal type name:...
Like SharePoint item programmatically
18/02/2016 15:20
make sure, you have referenced Microsoft.Office.Serverfollowing.dll and using ReputationModel namespace Microsoft.Office.Server.ReputationModel Like item Reputation.SetLike(list.ID.ToString(), itemId, true); Unlike...
Create View on Discussion List by Powershell
17/02/2016 09:34
I tried to create view by standard way, but the view still didn't show my columns...Following workaround copies Management view in which fields are visibleAdd-PSSnapin microsoft.sharepoint.powershell -ea 0$ErrorActionPreference = "Stop"$webUrl = "https://yourcommunitysite"$viewUrl =...
Sign in as different user
16/02/2016 11:07
Go to the location C:\Program Files\Common Files\microsoft shared\Web ServerExtensions\15\TEMPLATE\CONTROLTEMPLATES.Here we have a file named welcome.ascx.Put it somewhere between others SharePoint menu items<SharePoint:MenuItemTemplate runat="server" ...
Add Reply to Discussions List by Powershell
10/02/2016 09:16
Add-PSSnapin microsoft.sharepoint.powershell -ea 0
$webUrl = "https://yourCommunitysiteUrl"
$viewUrl = "/Lists/Community%20Discussion"
$parentId = 1;
$web = Get-SPWeb $webUrl
$listUrl = $web.ServerRelativeUrl + $viewUrl
$list = $web.GetList($listUrl);
$list.Title
$parent =...
Items: 31 - 40 of 384