Posts

Showing posts from 2016

SharePoint 2013 Performance Issue - Very slow when updating Enterprise Keywords field

Our SharePoint 2013 environment was behaving very slowly and one of the WFE utilization is crazy high.  It is particularly obvious when publisher is trying to update the Enterprise Keywords field (Managed Metadata field) for French site. After working with MS on troubleshooting, the root cause is identified as Outdated database statistics. Refer to this article for reference: https://support.microsoft.com/en-us/kb/3103194. Basically, we update the database statistics and remove cache following the article to execute the following. -- Update DB Stats EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN' -- Remove all elements from the plan cache DBCC FREEPROCCACHE This should be part of your DB maintenance on regular basis.

Add spell check dictionary in SharePoint 2010, SharePoint 2013, and Office 365

I was looking for how to add custom spell check dictionary in SharePoint 2013 and I found this blog that describes it, http://softlanding.ca/blog/adding-words-to-the-sharepoint-spell-checker-dictionary-(sharepoint-2013-2010). Here is the summary steps in case the above link doesn't work any more. At the root level of your site create a document library called " Spelling " (make sure to name the document library exactly as listed here) On your desktop create a new text file called " Custom Dictionary ", so that the file name looks like " Custom Dictionary.txt " (make sure to spell the file name exactly as listed here) Open the " Custom Dictionary " text file and in this file type in the words you would like NOT to be considered misspelled words (please note that the words are case sensitive so I would have a separate entry for Softlanding and softlanding, and also please make sure each word is listed on a new line) Upload the " C...

SharePoint 2013 REST API Query Items with cross site lookup column

Recently, I had to query items using SharePoint 2013 Rest API (/api/web/lists/getbytitle('')/items).  The problem that makes it hard is that it has a lookup column (Product) that looks up the items in a list from another web.  The typical $filter statement (/_api/web/lists/getbytitle('Pages')/items?$select=Title,Id&$filter=Product eq 1) doesn't work. After searching online and a few trial/error, I got it working by using /_api/web/lists/getbytitle('Pages')/items?$select=Title,Id,ProductId&$filter=Product eq 1 The ProductId field is automatically added to the list by SharePoint when you have a lookup field.  You have to $select that ProductId and then you can filter the Product field.  It's weird but it works.

SharePoint 2013 Client Side Rendering

I was looking for ways to add a custom field type using SharePoint app approach.  I found the following two good article that explain how it can be done.  With the app model, the custom field type control is just not possible any more. So, this is the way. http://blogs.technet.com/b/sharepointdevelopersupport/archive/2013/04/09/how-to-add-a-custom-field-to-blog-posts-in-sharepoint-2013.aspx http://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a Client side rendering actually helps to easily change how a list renders its items as well.  All this technique should work for Office 365 or SharePoint online.

SharePoint 2013 and Visual Studio 2015

If you want to setup a SharePoint 2013 development environment with Visual Studio 2015.  It will be mandatory to install and setup your SharePoint 2013 first then install visual studio 2015.  VS 2015 install .NET 4.6 and it will cause issue when installing SharePoint 2013.  As SharePoint 2013 is looking for .NET 4.5 (probably hardcoded somewhere) and when it can't find it, it can't be installed. You can refer to this blog for more information. http://geekswithblogs.net/bjackett/archive/2015/07/28/be-careful-installing-.net-4.6--visual-studio-2015-with.aspx I found out the hard way and it took me a while to uninstall Visual Studio 2015 and uninstall .NET 4.6 before I can successfully install SharePoint 2013. So be aware, the order matters!!!!

SharePoint 2013 Custom web part with rich text box that triggers SharePoint ribbon

I was creating a web part form which needs to have a rich text editor text box.  The SharePoint 2013 ribbon style works well and looks good.  So, I was looking to utilize it.  To keep the story short, I found the solution in a post, http://sharepoint.stackexchange.com/questions/64698/rich-text-editor-ribbon-based-in-a-webpart-in-sharepoint-2013. In case the link disappeared later, I copied the solution below. ASPX / ASCX: id = "editor" > id = "RTEDiv" tabindex = "0" > ID = "RTEDivHidden" runat = "server" /> class = "commands" > ID = "btnSubmit" Text = "Отправить" runat = "server" CssClass = "editorbtn" /> type = "button" value = "Отмена" id = "btnCancel" class = "editorbtn" /> Simple div container, future rich text div  id="RTEDiv" , hidden field to ...

SharePoint 2013 Using Publishing Page as custom forms for content type

I wanted to customize the display, edit, and new form for a custom list.  I took the approach of using a publishing web with custom web part.  The 2 methods that I use to accomplish that are as follow public static void AddWebParts(SPWeb web, string pageUrl, List webParts)         {             using (SPLimitedWebPartManager wpManager = web.GetLimitedWebPartManager(pageUrl, System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared))             {                                 foreach (WebPart webPart in webParts)                 {                     wpManager.AddWebPart(webPart, webPart.ZoneID, 0);                     wpManager.SaveChanges(webPart);     ...