2014-03-22

Ya the title has a lot to say and I am disappointed as I write this post.

So I came to a point while I am implementing a SharePoint 2013 project to a client in Egypt, where they are in need for the Organization Chart, ok no problem, or I thought no problem!!

I configured the User Profile, and started a My Site with a test user, then I looked for the Organization Chart, nothing!! Inserting it as web part after clicking “Sites” on top right, you can find under your name “Personalize this Page” to be able to insert a Web Part into My Site. Ok inserted the Web Part, of course the new name in 2013 is “Organization Browser Web Part” anyway..

Organization Browser Web Part is not by default in “My Site”

Problem:

Client doesn’t know SharePoint that well.. so WHO would edit his “My site” to add the Web Part!! Believe me even with a training to them, they won’t.. they will forget.. they are lazy.. CLIENTS J nothing new.

Solution:

Either I create a feature with event receiver that once activated, it adds the Organization Browser Web Part to all “My Sites”, I think we need as well a Timer Job to check later if there is a new “My site” created to add the web part to it.

Ok.. many steps & lots of work to do but doable, right.

Another case:

We need this Web Part on the Portal itself and not My site.. is when we will say “Sweet times” but it is “miserable times”

Just first enable this feature “SharePoint Server Enterprise Site Collection features”.

Problem:

Now try to add the Organization Browser Web Part in any page, its empty or call it blank or it is not working… I called it BUG.

Solution:

Add a Content Editor Web Part below the “Organization Browser Web Part” and add this script inside it & it will work & Voila!

After searching, I got the script from here

<script type="text/javascript">

 function CreateHierarchyChartControl(parentId, profileId, type, persistControlId) {

  var i = profileId.indexOf("|");

  var claimsmode = profileId.substr(i-1,1);

  if((i >=0 ) & (claimsmode=="w"))

  {

   profileId = profileId.substr(i+1,profileId.length-i-1);

   var initParam = profileId + ',' + type + ',' + persistControlId;

   var host = document.getElementById(parentId);

   host.setAttribute('width', '100%');

   host.setAttribute('height', '100%');

   Silverlight.createObject('/_layouts/ClientBin/hierarchychart.xap',

    host,

    'ProfileBrowserSilverlightControl',

    {

     top: '30',

     width: '100%',

     height: '100%',

     version: '2.0',

     isWindowless: 'true',

     enableHtmlAccess: 'true'

    },

    {

     onLoad: OnHierarchyChartLoaded

    },

     initParam,

     null);

    }

  }

</script>

 

Should I tell you Enjoy SharePointing!! Or just cry 🙁 anyway god bless us 🙂

About the author 

Mai Omar Desouki

Mai Omar Desouki is a Sr. SharePoint Consultant at Vodafone Egypt & previously in Infusion Dubai. Mai is Certified MCT, MCP, MCTS, MCPD, MCITP. She had done several SharePoint sessions; lately in the SP24, SPSBoston, SPSGulf, SPSUtah and in the European SharePoint Conference in Copenhagen & Dubai SharePoint Saturdays.

She has been working with Microsoft Technology for 7 years, with the main focus on SharePoint.Her main SharePoint deployments have been for customers in Egypt & Middle East region. She also has done multiple migrations for enterprise customers from MOSS 2007 to SharePoint 2010 & from SharePoint 2010 to 2013. Mai is focused on helping customers get the most business value.​​​