Posts

Showing posts from 2014

SharePoint 2013 Search Issues

Image
As we know Microsoft did lots of investment on improving the search architecture and did lots of changes in terms of UI prospective.  There are some of the common issue and well known, that I encounter during my development & search troubleshooting.   Below are the list of the common issues & the workaround to fix Automatic Crawl properties not created [Issue] This is known issue while creating the site column using declarative way the automatic crawled properties are not generated by the SharePoint engine.  [Solution]: The work around this either, need to create the Site columns using powershell or SharePoint object model . Display template not selected in the Content Search Webpart when we create the page using element.xml file. [Issue] The requirement where I have to create the layout pages and pre-populate the “content search web part” so I used the module feature for that & export the web part and add the same in the element. Xml file the issue

SharePoint 2013 Error: Search has encountered a problem that prevents results from being returned

Week ago I had encountered the most common issue “Search has encountered a problem that prevents results from being returned”. I had searched lots of article and find diff-2 solutions. 1. Reset the Index 2. Custom Search Property not configured properly. 3. Search Index is degraded : Recreate the search service application from Central Administration In my case, I had a search page, where I had configured the content search web part and core result web part. Only my Search result web part was throwing error “Search has encountered a problem that prevents results from being returned” other webpart i.e. content search webpart was working fine. In my content search web part, I was using custom template and custom Managed Properties, so the first question comes in my mind. Was this related to the OOB MP issue? To make 100% sure about this, I need some proof, for this I had create one custom template and apply the same template in search result web part and I

SharePoint 2013 free CodePlex Tools for debug

SharePoint Manager The SharePoint Manager 2013 is a SharePoint object model explorer. It enables you to browse every site on the local farm and view every property. http://spm.codeplex.com/ CAMLDesigner The CAML designer is a tool that helps you build your CAML queries to query SharePoint lists http://sharepoint.biwug.be/Pages/Downloads.aspx Property bag settings SharePoint Property Bag offers developers to store configurations settings at different levels of the SharePoint hierarchy outside of the application itself. http://pbs2013.codeplex.com/ ULS Viewer ULSViewer allows users to open a ULS log file and display its contents in a user friendly format. Users can then perform advanced functions. http://archive.msdn.microsoft.com/ULSViewer/Release/ProjectReleases.aspx?ReleaseId=3308 SharePoint feature admin Quickly review what features are installed. Detect faulty solutions. Mass activate and deactivate features. http://featureadmin.codeplex.com/ Search Query

Log4Net Custom Logger for SharePoint 2010 and 2013 (With Attached working Code)

Image
What is the Problem The big problem in SharePoint 2010/2013 to write the custom error to log files, whenever the error comes, the developer grab the associate correlation GUID and see the associated error in 14 hive folder. The log file also contains the bunch of other information as well. It would be great if somehow I can develop the custom logging feature for our project that is only specific to my project. It will reduced my effort and it would be a big win for me as a developer. Solution we would able to solve this problem by using 3rd party open source DLL “log4net” . We have written some custom classes to override the base function that would help us to write SharePoint logs into the 14 hive. These classes contain the logic for generating the logs under the same location, where the SharePoint logs are generated i.e 14 hives under different folder (This will help to get the exact information during the error and trace). Solution Dependency Log4Net Dll Important Confi

CryptographicException : Keyset does not exist (issue fixed)

Image
One of our project(SharePoint) requirements, we need to use the certificate to encrypt and decrypt the data by using the public and private key. So the code implemented on the DEV working fine, but issue comes when code deployed on the other servers. The error was “ Keyset does not exist ”. The base exception class of this error is “ CryptographicException ”. CryptographicException : Keyset does not exist 0(issue fixed) RSACryptoServiceProvider rsaEncryptor = ( RSACryptoServiceProvider )certificate.PrivateKey; This exception comes when the application pool account doesn’t have access to read the certificate private key. For this we would required to give the full access to the particular certificate. Followings are the required steps to fixing this issue. Solution Application Pool account doesn’t having an permission to access the private key value Steps 1.   Login to server Press Ctrl+R type to   MMC. 2.   File -> Add or remove snap-ins 3

Nintex Object Model 2013: Property Editors

Image
Deep dive during my practice hours found an interesting way of making Nintex control more customizable and yet not getting a much time to implement the custom property editor.  In " Nintex Form Object Model 2013: Render various types of properties " this post I had described the various type of properties that we can create using Nintex object model. To customize the properties more we have an another option called the PropertyEdior. The PropertyEditor is the control that we render in side the control.This is a property of the ControlPropertyInfo class.  The PropertyEdior option takes the GUID of control. This control  must be inherit with PropertyEditorBase abstract class and implement the following methods & properties. UniqueId (Property)  HandleControlPropertyDesignerPageLoad (Method)  HandleControlPropertyDesignerCreateChildControls (Method)  JqueryLoadInitializer (Method) The various type of “Nintex property” editors used by the Nintex Object mode

SharePoint 2010 Hide Ribbon using JQuery in "EnabledScript"

Image
Problem Understanding: In SharePoint ribbon control there is “EnabledScript” parameter that used to enable and disable the icon from the ribbon based on the condition logic in your method. So the requirement is to hide the button from the ribbon instead of disabled it. Requirement: Hide the button from the ribbon instead of disables it. Solution: In SharePoint ribbon control there is “EnabledScript” parameter that used to enable and disable the icon. So in this function I decided to hide the ribbon control using JQuery. Here comes the problem the ID of the icon is     “ DATA.SharePoint.Ribbon.NewControlInExistingGroup.NotifyLarge ” and it contains the “.” So to escape the “.” We required to add the “\\” in front of “.”. Implementation: So the following Script that I used to hide the ribbon icon. In this code I checked the controlexistId control existence and based on the logic I hide the icon. EnabledScript = "javascript:EnableDisable() function EnableDisable(

Nintex Object Model (Required Field validator to custom properties)

Image
Background: It almost take 2 days to find the way to apply the required field validator to the custom control properties. So I decided to share with this information to all other fobs working with Nintex object model. Goal: Apply Required Field validator to custom properties. So apply the required field validator we need to put the following code at the top of the properties attribute section. Required (ErrorMessageResourceType =  typeof (Core), ErrorMessageResourceName =  "ValidationFieldRequired" ) So the full code would be goes like this. The marked yellow are required parameters to make the fields to required.  [ControlPropertyInfo(ResourceType = typeof(Core), DisplayName = "MyRrequiredField", GroupName = "Rrequired", DisplayOrder = 6, Required = true, ChangeAction = ControlPropertyChangeActionType.DoNothing, TextMode = PropertyTextMode.MultiLine), Required(ErrorMessageResourceType = typeof(Core),

Nintex Form Object Model 2013: Render various types of properties

Image
Goal: Requirement is to create the various types of properties like Textbox & checkbox and dropdown list in Nintex object model. Background: To read about the Nintex forms object model , please read this blog. Steps: To achieve above functionality only we required to work on the ControlProperties class. By taking the ref. with this blog Nintex forms object model . The textbox already already implemented on the ref. post. So render the dropdown and check box only required to add the following lines of code in the ControlProperties class file. so below is the code using System.Runtime.Serialization; using Nintex.Forms; using Nintex.Forms.FormControls; using System.Collections.Generic; using Nintex.Forms.Resources; namespace CustomControl {     public class ControlProperties : BaseBindableFormControlProperties     {         /*Render Text box list*/         [DataMember, ControlPropertyInfo(             DisplayName = "Display Text",             Des

Nintex Custom Ribbon Control 2013 - Implementation Example (Custom Action)

Image
Goal: To create the custom action that going to display the button at Nintex form setting ribbon. Feature Scope: Site Identify the location: Using the IE developer tool you can identify Ribbon group.  Location: Nintex.Forms.SharePoint.Ribbon.FormDecustomer.FormTab.CommitGroup.Controls._children CommandAction: Display the Popup to show create filed form: ' _layouts/15/fldNew.aspx Element.xml < CustomAction    Id = " Custom.SharePoint.Ribbon.NewControlInExistingGroup "    Location = " CommandUI.Ribbon " Sequence = " 20 " >     < CommandUIExtension >       < CommandUIDefinitions >         < CommandUIDefinition Location = " Nintex.Forms.SharePoint.Ribbon.FormDecustomer.FormTab.CommitGroup.Controls._children " >           < Button Id = " Custom.SharePoint.Ribbon.NewControlInExistingGroup.Notify "                   Command = " Custom.Command.NewControlInExistingGroup.Not