locked
how to get manager of record owner in crm 2013 RRS feed

  • Question

  • Hi,

    I have set managers of all users in crm 2013. Now I want to get manager of record owner. Please tell me how to get manager.

    Friday, April 24, 2015 6:00 AM

All replies

  • Hi,

    If you want this in Workflow you can set as  Manager --> owing user from the right pane to ge it dynamically.

    If you want this in form, you can use javascript odata to get it:-

    1. Get current user id using below code:-

    var UserID = Xrm.Page.context.getUserId()

    2. Write an Odata query something like:-

    function Getinfo() {
    var context;
    var serverUrl;
    var UserID;
    var ODataPath;
    context = Xrm.Page.context;
    serverUrl = context.getServerUrl();
    UserID = context.getUserId();
    ODataPath = serverUrl + “/XRMServices/2011/OrganizationData.svc”;
    var retrieveUserReq = new XMLHttpRequest();
    retrieveUserReq.open(“GET”, ODataPath + “/SystemUserSet(guid'” + UserID + “‘)”, true);
    retrieveUserReq.setRequestHeader(“Accept”, “application/json”);
    retrieveUserReq.setRequestHeader(“Content-Type”, “application/json; charset=utf-8″);
    retrieveUserReq.onreadystatechange = function () {
    retrieveUserReqCallBack(this);
    };
    retrieveUserReq.send();

    }

    function retrieveUserReqCallBack(retrieveUserReq) {
    if (retrieveUserReq.readyState == 4 /* complete */) {
    if (retrieveUserReq.status == 200) {
    var retrievedUser = this.parent.JSON.parse(retrieveUserReq.responseText).d;
    if (retrievedUser.FullName!= null)
    alert(retrievedUser.[Manager field name]);
    }

    Thanks,

    Prasad

    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.


    Friday, April 24, 2015 6:15 AM
  • Lets say you have a lead which is assigned to user X and he reports to user Y (Manager). Now one way of seeing these records is in a view.

    To view them in a view you need to Add these fields in the view. So when you customize View for leads, Select "Owner" which will give you fields of user entity and from there select Manager.


    Regards, Abhishek Bakshi If you find this post helpful then please Vote as Helpful and Mark As Answer. Check my blog on https://mydynamicscrmblog.wordpress.com/

    Friday, April 24, 2015 6:21 AM
  • I want to send email to manager of owner. how to get manager in  email workflow
    Friday, April 24, 2015 7:13 AM
  • Hello Aamir,

    When you create workflow, set "Manager of the Owning user" in To assuming you want to send email to the manager of the record owner. I am attaching screenshot below

    Hope it helps!


    Regards, Abhishek Bakshi If you find this post helpful then please Vote as Helpful and Mark As Answer. Check my blog on https://mydynamicscrmblog.wordpress.com/

    • Proposed as answer by Minal Dahiya Friday, April 24, 2015 10:26 AM
    Friday, April 24, 2015 7:20 AM