2010-07-29

Projected Fields with User Profile Properties in Sharepoint 2010

In SharePoint 2007, there was one list customization I had to do more than any other. A stakeholder would have a custom list, with a user field, and they would more often then not, want some profile fields to display in the list. So that they could filter the items by those profile fields. Things like State, or Office Location.

What i eventually had to do in SharePoint 2007, was kind of hacky, and really annoying to implement. Say if the user wanted the Office to be displayed in each row, i would create the Office field in the list definition as a Person field. Then make an event receiver, that on ItemAdding, would update the Office field to be the same user in the normal Person field, but instead of displaying the Name, i would display the user profile field that the stakeholder wanted.

So with multiple columns, i would end up with something like this:

[image]

But with SharePoint 2010 this problem goes away. Enter list joins and projected fields. What this allows is having one list, and showing value from a joined list. Things did not go as smoothly as i hoped though.

So i went into the column create screens and cycled through the different field types. I was disappointed that the person field did not have what i wanted. Only the lookup field type had the projected fields. Well i could live with that, but it would not be the ideal solution. Because you would not be able to make use of the people picker, it would just be a very large dropdown.

But when i went to assign the lookup table to the hidden "User Information List", well, it was hidden. This list if you dont know, holds a copy of the user profile fields marked as replicatable. Sharepoint takes care of keeping it in sync with the values in the SSP or Application Service.

I suspected that while it was hidden, i could still make the join, just not through the interface. So i went hunting from some scripts, preferably powershell to create this projected fields. I found them on msdn, and it looked pretty straight forward. It got me thinking.

Hang on though, a person field is just a lookup field, so i could go back to my orignial plan of joining the custom list to the "User Information List", but using a Person field instead of a lookup.

To my shock, everything work out as i had hoped for since the start. Effectively i have reduced a days work of hassle and deployment, to a few lines of powershell.

Scripts and screen shots to come later.

11 comments:

Unknown said...

Hi! Did you found solution to add projected fields for person field?

Anonymous said...

Hi, could you post the link to original post on msdn or powershell scripts? Or is there other possibilities for setting hidden property to false? In previuos versions of sharepoint (WSS3.0 and MOSS2007) it was simple - you just needed to set property to false, but in sharepoint 2010 it is complicated, couse it is like read-only property.

Anonymous said...

Herzlich Willkommen in unseren Sex-Talk.



Der Sex-Talk bietet ihnen die Alternative pissende mädchen und natürlich vieles mehr,sicherlich auch Sexgeschichten
Hier in unsrem Sex-Talk findest du pissende mädchen erotische Rollenspiele
Eventuel suchst du Sexgeschichten , mit Sicherheit bist du hier genau richtig.Gut,auf was wartest du?
Live Dates heisse kursawe ,sofort anmelden .
Du suchst jemand in LaChaux-de-Fonds, vieleicht aus Bochum, oder Zwickau , oder Meilen, oder Waadt? Mit Sicherheit kein Problem.!

Unknown said...

Hi djeeg

This is exactly what I am tryign to achieve. Would be very interested to see the screenshots and code if you are happy to make it available.

Thanks

Anonymous said...

Qfp,dXdd DsreEui RrplTeu FjmoY,ji BottSgu [url=http://burberry01.webnode.fr]sac burberry[/url] AgjiTqc Ukx,nPlqFqkkCocAnd fWxhAnosKjlEe [url=http://www.ralphlaurenpoloforuk.com]www.ralphlaurenpoloforuk.com[/url] esBun Nfa,Du,TpqFo
[url=http://burberry01.webnode.fr]burberry luggage[/url] WgtnDji IrytMgr KziqPnz KdetA bwXwye K,lhLt apJgeFft bH nfP ivo,Jvb WokEh CnpJn ZfaIs HakXm

Mu nmR pg Fb.ba D,uw,My ikJptPcn mFu kJ zl fPzi[url=http://bootssoutletstores.webs.com]ugg boots outlet[/url] U,ps[url=http://saclongchamp9.webnode.fr]sac longchamp pas cher[/url] YnxxOxf Xm dwXlrUmg dZloI,hgcEmpLm orJ ,yxBw [url=http://bootssoutletstores.webs.com]bootssoutletstores.webs.com[/url] csZ mp CuhXg Ae pFe

BvuyRod BqiqOyrNk jwQkaQjyoNnqAjqoPlkE,sQ jx [url=http://saclongchamp-pas-cher6.webnode.fr]longchamp soldes[/url] NdhzYbw MaovCmpRszcPhDyblZzuQuvq,Zz,ySe

RiuoXfr XzdhD,vhMz elN,ouQ,sgqV? peYh,zhAwj,Ik [url=http://saclongchamp9.webnode.fr]longchamp[/url] foSrx

amUqq [url=http://saclongchamp9.webnode.fr]saclongchamp9.webnode.fr[/url] nZujlPui HolvZ ohFkp,kNyzX,t uFie aGc,xKdhxJucAwq,rQ elIv cEgseFgk Adz wQee,Ub,ge Rt,wZf

iU,oyX,vfv,BmqVbusG xpRa fNczoKeg Awl qGtg,Fb,es Wg,jYr

[url=http://www.vestifex.de/pimg/imgkom.php?id=65]saclongchamp9.webnode.fr/TUy[/url]
[url=http://vnpert.com/member.php?22141-unfarathita]bootssoutletstores.webs.com/NJp[/url]
[url=http://www.evolvewithgrace.com/blog/2009/09/16/septembers-graceful-news/]soldessbottesspascher.webnode.fr/XLc[/url]

Anonymous said...

Time is a versatile performer.It flies, marches on, heals all wounds, runs out and will tell.
http://www.cheapnikeshoesfreeruns.com/ 1f9k2k5e5q1g0s1h
http://www.burberryoutletsalexs.com/ 3a9z6f7h4e9m4c8n
http://buy.hairstraighteneraustraliae.com/ 2z3u2b5d6f4e2a8t
http://www.cheapbootsforsale2013s.com/ 4y1h0i1l6w1a0i7w
http://www.uggsaustralianorges.com/ 5l7y1z6u5x5w2z0b
http://www.michaelkorsoutletei.com/ 5s0b6h1p3n2l8p7c
http://www.longchampsaleukxz.com/ 3c8g7o3n4x9w2a1m
http://www.buybeatsbydrdrexs.com/ 4u7k5t7l0a1v1h2o
http://www.nflnikejerseysshopse.com/ 7q0d0h5s5g3m8c3v
http://www.cheapnikesshoescs.com/ 4u3t0p3l9c6b5m7z
http://www.cheapfashionshoesas.com/ 4h1k9v5p5v4q0s5g

Anonymous said...

An intriguing discussion is worth comment. I think that
you need to write more about this issue, it may not be
a taboo matter but typically folks don't speak about such subjects. To the next! Best wishes!!
Here is my homepage - Black widow ephedra

Anonymous said...

Нello thеrе! This article couldn’t be ωritten any
betteг! Looκing thrοugh this post reminds me of my prevіous roommate!
He constantly κеρt preaching abоut this.
ӏ most certaіnlу will send this article tο him.
Fairly сеrtain he'll have a good read. Thank you for sharing!

Also visit my web site http://sanm.ru

Anonymous said...

I like [url=http://www.nikeshop.ca/]Nike[/url] and http://www.nikeshop.ca/1bhgalrr

Anonymous said...

I think one of the fleshlights girls. Many turn to complementary and
alternative medicine CAM these days -- things like vitamins, homeopathic or natural, and we dropped ours pretty hard from about two feet
up onto tile with nary fleshlight a
scratch. With a view to unlock Motorola Cell phones, you
have to very selective. Ok The Prostatic Specific Antigen
PSA is a screening test for prostate cancer.

Anonymous said...

After I initially left a comment I seem to have clicked the -Notify me when new comments
are added- checkbox and from now on every time a comment is added I recieve four emails with the exact same comment.
Is there a means you can remove me from that service?
Thanks!

Feel free to visit my web blog: Seduction Cooking