Tuesday, June 11, 2013

How to get the total record count in the customized xslt of a list view

The total of record count is sometimes useful when showing up on the list view. It’s a bit hard to get it directly from the list xml data (not sure whether it’s possible). The following is an easy approach.

First, you’ll need to modify you view to include the ID column. Then under the totals, set Count for the ID column in the dropdown.

image

image

Now save the view and open it in SharePoint designer, click Customize XSLT>Custom Entire View

image

Notice that in the xslt we have the following defined:

image

You can now define a global variable for the total count of records

image

This global variable can be used for customized pagination as well as just displaying the count of records on the page. After all this done, you can hide the id column by modify the xslt a bit.

Wednesday, August 24, 2011

Scripts to set up people picker from a different trusted domain

stsadm -o getproperty -pn peoplepicker-searchadforests
stsadm -o setproperty -pn peoplepicker-searchadforests -pv "forest:domain.com,domain\username,password;domain:domain.com,domain\username,password"
stsadm -o setproperty -pn peoplepicker-searchadforests -pv "domain:domain.com,domain\username,password" -url http://domain.com:90