SharePoint 2013 ClientPeoplePicker

Okay we and I have been stumbling around with this neat new control named ClientPeoplePicker in SharePoint 2013. One on the interests in this control is to use it in own web parts. Now if you just simply add the control to web part (or aspx page), you’ll get it working like charm.

However default approach limits the ClientPeoplePicker to return only users from SharePoint, the ClientPeoplePicker does not return SPGroups or Active Directory Groups or Security Groups nor Distribution Groups. As for the default use in SharePoint built in forms/web parts do allow SPGroup to be returned to screen so it is more of the configuration side.

Fortunately after some digging I were able to find out more to this. At the PeopleEditor, default limitations for the results are defined with “SelectionSet” which accepts string containing what is desired (btw. in SharePoint 2013 this will also be set on “User” only, can’t remember correctly was this on default at SharePoint 2010). Now at the ClientPeoplePicker this property is named PrincipalAccountType. By default the PrincipalAccountType is set to “user”. Changing this value for example “User,SPGroup” will allow ClientPeoplePicker to return users and groups. Also there is possible to use “User,SPGroup,SecGroup,DL” selection which will return almost everything you can possibly want from Active Directory.

Currently MSDN documentation does not say anything extra on this property, but that is sure to change at some point. Enjoy if you happen to be stumbling in this topic.

Posted in SharePoint 2013 | Tagged | 1 Comment

SharePoint & IIS & HTTP 500 error

Sometimes I’ll have to wander around a bit less developer side and more into admin side. Now here is one interesting challenge: SharePoint site started serving HTTP 500 error and nothing more after install of 3rd party software.

This problem was quite bit odd since the event viewer & logs seemed to be allright, no findings there. After good while of investigating I managed to scoop out IIS Logs and followed as I tried to re-open site. When I found my browser requests from IIS logs I found out the additional “sub error message”, sc-substatus 19 -message (the line went like sc-message 500, sc-substatus 19). Now at the IIS 7.5 these messages indicate more serious problem inside IIS configuration and some ideas were thrown around about reinstalling IIS or restoring IIS Metabase.

Keeping this in mind I just hit the old fashion “aspnet_regiis -i” -line and smack, It started working again 🙂 Apparently there was something wrong with the config & .NET Framework & etc and luckily the aspnet_regiis was able to restore situation.

Posted in SharePoint 2010 | Leave a comment

SharePoint 2013 PeopleEditor

Okay I am back and I have something in my mind.

So now the SharePoint 2013 is available and I am developing software upon that platform. Now very first things what I found from the change list was intresting “new” peopleeditor. When you create standard SharePoint list & add column that is type of People, then you’ll get the new looking people editor which allows email addresses and more importantly shows search results on below the editor.

The old peopleeditor got a few new properties such as “AcceptAnyEmailAddresses”, but more importantly there is new control named “ClientPeoplePicker”. This picker is actually being used in built in SharePoint forms. Old picker works the way it should be but this is intresting new control and I am still exploring the differences.

Posted in SharePoint 2013, Uncategorized | Tagged , , | 2 Comments

Workflow starts and immediately gives “Error Occurred”

Yet one small thing to remember and I hope that someone else will find this posting useful. Consider following scenario: SharePoint Workflow (Visual Studio Worklow -style) runs fine on development environment. From development the workflow is brought to testing (or production if not the happy world) by using wsp’s or other methods.

In testing the workflow immediately gives message “Error Occurred” and in SharePoint logs following line is found with category of Workflow Infrastructure: “Object reference not set to an instance of an object”. In this case I found that this error message is given as the Content Type that workflow uses is not found on Task List. Usually this one goes well when doing a new deployment but if you have deployed earlier and update your workflow with changes to content type then this is possible error.


Usually “Object reference not set to an instance of an object” means that something is missing. It can be missing column from the list or in this case missing content type. This is relatively easy to fix (associate a content type to tasklist or as update procedure delete existing tasklist and create new one from workflow association screen).

Posted in Uncategorized | Leave a comment

Using External Content type or list controls in custom webpart

Okay some time has passed after last post but now I have something pretty interesting in my mind. Lately I have been digging SharePoint 2010’s External List and External Content types (Business Connectivity Services, BCS). I need to make my own webpart (Visual Web Part or the regular one) that makes use of the picker that Microsoft uses when you set up your list with either directly External Content type or through lookup field to External List.

From the background I knew instantly that this will be tricky one (due to fact that External List Items are not like SPListItem’s and enumerating external list from code requires bits and pieces of extra with user security and so on).

If you look standard SharePoint 2010 edit form page with developer tools (in IE9) you’ll see that in UI there is mention about the SPFieldBusinessData. Now if you try to search with that term you’ll find pretty much nothing and Visual Studio does not help you either. At first I was hoping that yes it is like regular field in SharePoint but no luck.

After digging more I found some intresting posts about setting up ItemPicker with ExtendedData. Through UI this looks exactly same as the normal SharePoint’s External Item Picker but requires quite good amount of work setting up the ExtendedData. Also I found this not so appealing since in List we have done work already by defining External Content Type and some more properties.

So the search continued to next solution. After digging more into this I found quite nice solution at the moment for this problem. From some forum posts I found references to BusinessDataFieldControl (Microsoft.SharePoint.WebControls -namespace). If you just put this control to your page you’ll end up getting error about the null controls. This was not a good sign. However now there are big thanks to IntelliSense: from that control you can find properties like ItemId, ListId and FieldName. After setting those three properties you’ll get the control showing up and it works when picker dialog is opened (that nice “instant search” by giving some values to control is not working just yet). This was exactly the easy solution what I was looking for but however there are some limitations currently present.

Although I am still considering about using ItemPicker or keep still on searching for the perfect solution. With BusinessDataFieldControl you can find the data from external source but you can get only one line back at the time (let’s say that you have given the external column to show Company from external source and when you pick the company from dialog you just get the company and nothing more).

The search continues…

Posted in Uncategorized | Tagged , , , | 1 Comment

Passed the 70-576: PRO: Designing and Developing Microsoft SharePoint 2010 Applications Test

Finally I got the “last part” of my SharePoint 2010 certification path completed and archieved the MCPD: SharePoint 2010 Developer certification. All what I can say is that books from the course 10232A are good materials for the exam.

Posted in Uncategorized | Leave a comment

SharePoint: differences between SPListCollection and SPListItemCollection

Okay the topic might not be as accurate as possible but here is something that I bet almost every SharePoint developer has faced, but might now have had any second thoughts. Back in C# language “principles”, it is not possible to modify collection (List<>, ArrayList, so on) while enumerating it (basically comes exception that says so).

Now here is interesting part: SPListItemCollection allows to perform .Update() into it’s items without exception (and everything goes out fine). But when trying to do so for example SPListCollection, you’ll get the familiar error (altought error might be hidden in SharePoint Hive Logs or your own logging system) about modifying collection and enumeration not possible.

I thought to add this entry since I spoke with couple other SharePoint developers and found out that okay this is how things go but never had a second thought for the matter. I am sure that someone else can dig deeper into this and why this is so. And feel free to do so.

Posted in Uncategorized | Leave a comment