SharePoint Use Cases

  • Home
  • About
  • Our Tools
  • Contact me
SharePoint

Use case: PhoneBook Search – no code required

Toni Frankola - August 20, 2009

In last few years I worked with many clients in different industries. Every company I worked with had one application in common: a centralized phonebook. These apps are usually written by some IT rookie that had a desire to show how good his at “3 letter acronym” technology (ASP, PHP…)

Phonebooks are being used when an employee needs to call a coworker on office number or when a receptions wants to inform you that someone is waiting for you in the lobby. In large organizations you must have such an application.

people-search2

Windows SharePoint Services already has Contacts list feature built-in, it only misses one thing: some form of quick search of contacts. So I made search-as-you type functionality for WSS Contacts list.

It is similar to Search as you type by Jan by it does not require MOSS and it searches only one list. So if your search is not working or not indexing your contacts this web part will still work.

Deploying

  • Upload this web part or paste this script to Content Editor Web Part
  • Modify the following two lines with your SharePoint URLs and Contacts list name

var sharePointSite = “http://<sharepoint_site_url_with_contacts_list>”; //e.g. “http://intranet”

var contactsListName = “Contacts”; // enter your Contacts list name here

  • (Optionally) Update Jquery location if you would like to use it from another location

Credits

I was partially inspired by Search as you type by Jan Tielens, I used Javascript API for the SharePoint webservices by  Darren Johnstone to query the data and  jQuery PHP Ajax Autosuggest by Ashley to create suggestion drowpdown.

Hope you will find a good use for this one…

Tags | phone book, use cases, web parts
 0
Share Now

Toni Frankola

Entrepreneur, IT consultant, speaker, blogger, and geek. Co-founder of syskit.com.

You Might Also Like

SharePoint

Web parts and extended portals

July 26, 2007
SharePoint

SharePoint CAPTCHA

March 10, 2008
SharePoint

Ready Steady SharePoint!

May 16, 2008
SharePoint

Displaying a number of items in a list

November 24, 2008

18 Responses

  • RF August 21, 2009 at 8:57 am

    Hi – that’s great – thank you. One question – does it have to be a specifically a “contacts list” to work? We have a custom list that we modfied to hold our contact information that is imported form active directory.

  • Thangeswari August 21, 2009 at 12:53 pm

    Thank you very much for sharing the useful script.Really cool.

  • Toni Frankola August 24, 2009 at 10:04 am

    @RF: You would have to make some minor modifications to the CAML query and the results part of the code and use it with any other custom or OOTB SharePoint list. Let me know if you need some help with it…

  • Jason August 26, 2009 at 12:08 am

    @Toni: turns out it does work on https, I didn’t realize the list has to be named Contacts even though there is a variable at the top of the script to define the name of the List.

  • Toni Frankola August 26, 2009 at 12:29 am

    Oh, great!!!

  • Craig August 31, 2009 at 1:17 pm

    I’m trying to use this for our intranet and keep getting an access denied JS error … any ideas?

    This would really help in a couple places, so I’d like to get it working.

    Thanks,

  • Toni Frankola September 14, 2009 at 12:02 pm

    @Craig: Can you post the actual JS error?

  • vêtements enfants September 28, 2009 at 12:57 am

    Pretty good this site

  • Dan November 2, 2009 at 2:26 pm

    I to would like to use this w/ a custom list that we created for contact information (with lots of custom fields)…
    Toni you had asked post #1 if he needed any help to let you know, also he didn’t post back if he had any success..either way, If you could just possibly give some more elaboration as to what and where in the file to modify…as i’m not sure what caml is exactly, it would greatly be appreciated!

  • Toni Frankola November 3, 2009 at 9:30 am

    @Dan email me via contact form.

  • mersin web tasarım December 18, 2009 at 5:44 pm

    Hello, very very good web site. Thank you.

  • mersin tüp bebek merkezi December 22, 2009 at 1:10 pm

    Hello, beautiful site. Thank you.

  • Jure January 20, 2010 at 3:51 am

    Hi!

    Script doesn’t work in localized version (I’m using Slovenian and I’m getting Internal Server Error). If site has English for default language, than it works normally.

    Now, becouse I have no programming skills at all, my question is: what should I change in scripts (probably var names for FirstName etc?)?

    Thanks!

  • Toni Frankola January 20, 2010 at 4:19 am

    @Jure: Yes, ever localization has different internal field names and you need to change the CAML query to match names in your localization. This tool is very helpful for discovering internal field names: http://www.u2u.be/Res/Tools/CamlQueryBuilder.aspx. Give it a try! In case you cannot resolve it ping and I will see what I can do.

  • Janko January 26, 2010 at 1:11 am

    hello,

    I`ve made some modifications using the CAML tool posted before.

    var sharePointSite = “http://portal.domain.com”; //e.g. “http://intranet”
    var contactsListName = “Contacts”; // enter your Contacts list name here

    $(document).ready(function() {
    $(“#Search”).keyup(function(e) {
    var query = $(this).val();

    var lists = new SPAPI_Lists(sharePointSite )
    var items = lists.getListItems(
    contactsListName, // listName
    ”, // viewName
    ‘+query+’, // query
    ”, // viewFields
    30, // rowLimit
    ‘TRUE’ // queryOptions

    However I get no errors and also no results??

  • Janko January 26, 2010 at 1:14 am

    some rows were not posted …

    again ….

    // viewName
    ‘+query+’, // query
    ”, // viewFields
    30, // rowLimit
    ‘TRUE’ // queryOptions

  • Kim G February 12, 2010 at 1:28 pm

    AWESOME! Do you know how to get the message for mixed content to stop happening without having everyone make the the fix in IE8? “do you want to view only the webpage content that was delivered securely” … is it something to do with a reference in the code?

  • Jim March 31, 2014 at 11:28 am

    Hi,

    I found your script very useful and I tried to use it on our sharepoint 2010 but it doesn’t work. I changed the lines accordingly and paste the script in content editor webpart but when I tape name to search it shows nothing, and when I hit enter I hear only a sound but nothing happens then. Please can you help me? And how do I need to customise my list to fit the CAML query in your script?
    Many Thanks,

    Jim

  • Comments are closed.

    Previous Post Question about your article – Setting up SharePoint Environment
    Next Post Boarding completed!

    Archives

    • December 2021 (1)
    • June 2021 (1)
    • January 2021 (1)
    • July 2019 (1)
    • June 2019 (2)
    • March 2019 (1)
    • February 2019 (3)
    • October 2018 (2)
    • August 2018 (2)
    • June 2018 (1)
    • April 2018 (1)
    • February 2018 (1)
    • January 2018 (1)
    • June 2017 (1)
    • April 2017 (1)
    • February 2017 (1)
    • November 2016 (2)
    • August 2016 (1)
    • July 2016 (2)
    • March 2016 (1)
    • February 2016 (2)
    • January 2016 (1)
    • November 2015 (2)
    • December 2014 (1)
    • November 2014 (2)
    • July 2014 (2)
    • June 2014 (2)
    • May 2014 (1)
    • April 2014 (2)
    • March 2014 (1)
    • February 2014 (4)
    • January 2014 (2)
    • December 2013 (1)
    • September 2013 (1)
    • July 2013 (1)
    • June 2013 (1)
    • May 2013 (1)
    • April 2013 (3)
    • February 2013 (1)
    • December 2012 (1)
    • November 2012 (1)
    • September 2012 (1)
    • August 2012 (1)
    • July 2012 (2)
    • June 2012 (4)
    • April 2012 (1)
    • February 2012 (1)
    • January 2012 (1)
    • November 2011 (2)
    • October 2011 (2)
    • September 2011 (2)
    • July 2011 (3)
    • May 2011 (2)
    • April 2011 (1)
    • March 2011 (4)
    • February 2011 (3)
    • January 2011 (4)
    • December 2010 (4)
    • November 2010 (3)
    • October 2010 (3)
    • September 2010 (4)
    • August 2010 (1)
    • July 2010 (4)
    • May 2010 (2)
    • April 2010 (2)
    • March 2010 (3)
    • January 2010 (2)
    • December 2009 (3)
    • November 2009 (5)
    • October 2009 (2)
    • August 2009 (7)
    • July 2009 (3)
    • June 2009 (4)
    • May 2009 (3)
    • April 2009 (5)
    • March 2009 (8)
    • February 2009 (5)
    • January 2009 (8)
    • December 2008 (9)
    • November 2008 (8)
    • October 2008 (7)
    • September 2008 (4)
    • August 2008 (6)
    • July 2008 (5)
    • June 2008 (3)
    • May 2008 (4)
    • April 2008 (6)
    • March 2008 (4)
    • February 2008 (3)
    • January 2008 (6)
    • December 2007 (1)
    • November 2007 (3)
    • October 2007 (3)
    • September 2007 (2)
    • August 2007 (1)
    • July 2007 (12)
    • June 2007 (2)
    • May 2007 (3)

    Connect Us

    All postings on this blog are provided “AS IS” with no warranties, and confer no rights. All entries in this blog are my opinion and don’t necessarily reflect the opinion of my employer.

    • Home
    • About
    • Our Tools
    • Contact me

    Copyright (c) Toni Frankola 2008. - 2019.