AnswerBun.com

Org Browser start at a specific user for SP 2013

I have added an Organization browser to a page and was able to have it visible using the below code.

What I am wondering, is how I can have the browser begin with a specifc user and not the viewing user?

Code used:

<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>

SharePoint Asked by Brandon Black on December 16, 2020

2 Answers

2 Answers

Try this one. slightly modified, finally worked for me.

<script type="text/javascript">

function CreateHierarchyChartControl(parentId, profileId, type, persistControlId, flowDirection, silverLightControlId)
{
    profileId = "WINDOWS\username"; //added line

    var initParam = profileId + ',' + type + ',' + persistControlId + ',' + flowDirection + ',' + silverLightControlId;
    var host = document.getElementById(parentId);

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

    Silverlight.createObject('/_layouts/ClientBin/hierarchychart.xap',
        host,
        silverLightControlId,
        {
            top: '30',
            width: '100%',
            height: '100%',
            version: '4.0.50401.0',
            isWindowless: 'true',
            enableHtmlAccess: 'true'
        },
        {
            onLoad: OnHierarchyChartLoaded
        },
        initParam,
        null);
}

</script> ​​ 

Answered by Jaitsujin on December 16, 2020

add the 'accountname' parameter to your URL:

http://www.mysite.com/orgbrowser.aspx?accountname=domain/useraccount

Not sure why you created a javascript for this though - there is a web part you can just drop into the page...

Answered by Kolten on December 16, 2020

Add your own answers!

Related Questions

Workflow task – How to set priority when assigning a task

1  Asked on December 28, 2021 by etho201

     

SharePoint 2010, how to change column width in list view

2  Asked on December 28, 2021 by j-osborn

     

Logical Architecture of SharePoint

1  Asked on December 26, 2021 by dasarp

   

Link Tracking Breaks Large List Views in Modern

2  Asked on December 26, 2021 by eliot-at-projectfive

       

Manipulate Filters in Javascript

1  Asked on December 24, 2021 by out-shire

       

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.