Category Archives: SharePoint 2016

CountDictionary is undefined

When migrating custom solutions from an earlier version of SharePoint to SharePoint 2016 you might run into this javascript error.

Most likely when you try to count how many items are selected in a listview.

The code of the origional function (which probably still exists, but is now scoped to that SharePoint functionality within the javascript file (inplview.js)) looked like this:

function CountDictionary(b) {
var a = 0, c;
for (c in b)
return a

We see in 2016 that this is used to retrieve the number of currently selected items:


So you could use that instead.