Tuesday, 23 April 2013


How to get different types of field values in client object model (ECMA script)


·         Title – SP.ListItem.get_item(‘Title‘);

·         ID – SP.ListItem.get_id();

·         Url -SP.ListItem.get_item(‘urlfieldname‘).get_url()

·         Description – SP.ListItem.get_item(‘descriptionfieldname‘).get_description();

·         Current Version – SP.ListItem.get_item(“_UIVersionString“);

·         Lookup field – SP.ListItem.get_item(‘LookupFieldName’).get_lookupValue();

·         Choice Field – SP.ListItem.get_item(‘ChoiceFieldName‘);

·         Created Date – SP.ListItem.get_item(“Created“);

·         Modified Date – SP.ListItem.get_item(“Modified“); -> case sensitive does not work with ‘modified’

·         Created By – SP.ListItem.get_item(“Author“).get_lookupValue());

·         Modified by – SP.ListItem.get_item(“Editor“).get_lookupValue());

·         File – SP.ListItem.get_file();

·         File Versions - File.get_versions();.

·         Content Type – SP.ListItem.get_contentType();

·         Parent List – SP.ListItem.get_parentList();

Sunday, 7 April 2013


People Search using Custom Property value



  • Say you have a custom property called “Employee ID” in the user profile service application.
  • Make sure the property’s default privacy setting is set to “Every One” and option “Indexed” is checked.
  •  Do a full crawl of the people search.
  • You will find a crawled property for the same (Crawled property will be generated only when you have data for that property). Map the same to the “content hidden” meta data property.

 





  • Do an index reset and full crawl of the people search.
  • You can start searching for the user with employee id.




Wednesday, 3 April 2013

Displaying a custom user profile property value in the people search results


1.       Create a custom property say “seatext” as follows in the user profile service application.

 





2.       Do a full crawl of people search content source and make sure the following crawled property is present in the search service application.

 

3.       Create a new Meta data property and map the above crawled property to it.

 




4.       Now go to the people search results page if the search centre is configured for the my site as

 


 

 

5.       Edit the page and find for the people search core results web part and edit the web part.


6.       Make sure to add the meta data property above in the fetched properties section as follows:

 

<Column Name="seatext" HitHighLight="true"/>

 

7.       Then open the xslt editor and find for the the template for single search result

<xsl:template name="SingleResultInternal"> and declare a variable in that section as follows:

<xsl:variable name="hasext"        select="string-length(seatext) &gt; 0"/>

8.       Then find for the following div  <div id="ContactInfo">

<ul id="MiniContactCard">

And paste the following <li> at the place required:

 

<xsl:if test="$hasext">

          <li id="ExtField">

            <b>Seat Extension:</b>

            <xsl:apply-templates select="hithighlightedproperties/seatext" />

          </li>

        </xsl:if>

And save the xslt editor and click ok and checkin or publish the page. Check the result by searching for a user who is having a value for that property in the user profile service application.

 

Tuesday, 2 April 2013


Mapping term set to user profile property

Say for example we have a property called “Ask Me About” which is actually takes free text entered by the user in my site. We can restrict the user to select only fixed values by attaching the property to a term set of meta data service app as follows:
 
Step 1: Create a term set
 
 
Step 2: Attach to the user profile property

 

Step 3: User interface while updating the profile