Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

View to show records for current user's business unit and child business units

Jump to Best Answer
  • 1.  View to show records for current user's business unit and child business units

    TOP CONTRIBUTOR
    Posted Jun 25, 2020 05:56 AM
    I am trying to create a view, that will show the opportunities in the current user's business unit and child business units.

    E.g. if the current user is in business unit A, the view should shows opportunities for business unit A, B, C and D.

    Creating a view that shows opportunities for the current user's business unit is, relatively, straight forward:


    However, utilizing the business unit hierarchy in a view seems a bit more complicated - or at least to me. Or, it might be that it is not possible without using code.

    Has anyone successfully done this?

    Any input is appreciated 🙂

    #Functional


    ------------------------------
    BR,
    Niels
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: View to show records for current user's business unit and child business units
    Best Answer

    TOP CONTRIBUTOR
    Posted Jun 26, 2020 05:20 AM
    I don't believe this is possible - there is no FetchXML filter to represent "my business unit or below".

    You could use the hierarchy filtering option ("Under"), but there is no automatic way of filtering this by the current user's business unit, only by a fixed business unit. Using this method you'd need separate views for "Opportunities under Business Unit A", "Opportunities under Business Unit B" etc. rather than a single " "Opportunities under my Business Unit".

    I think the only way of getting it to work with a single view would be to use a plugin on the RetrieveMultiple message to dynamically rewrite the query based on the current user's business unit.

    ------------------------------
    Mark Carrington
    Chief Technologist
    Data8
    Chester
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 3.  RE: View to show records for current user's business unit and child business units

    TOP CONTRIBUTOR
    Posted Jun 26, 2020 06:32 AM
    Thanks for your input, @Mark Carrington.​

    I was hoping it might be possible using some FetchXML ninja tricks but it doesn't seem to be the case. Using a plugin is not a viable solution for us.

    ------------------------------
    BR,
    Niels
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 4.  RE: View to show records for current user's business unit and child business units

    TOP CONTRIBUTOR
    Posted Jun 26, 2020 01:44 PM
    Do the users need organization-wide permission to view opportunities?  If not, their view would default to only showing them opportunities this way if their permission is set to read opportunities at parent/child level instead of org level.

    ------------------------------
    Jill Vazquez
    Technical Specialist - CRM
    Bioventus, LLC
    Durham NC
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 5.  RE: View to show records for current user's business unit and child business units

    TOP CONTRIBUTOR
    Posted Jun 29, 2020 01:53 AM
    @Jill Vazquez ​all users need organization-wide permissions to opportunities, so unfortunately we can't use that solution. 

    ------------------------------
    BR,
    Niels
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 6.  RE: View to show records for current user's business unit and child business units

    TOP CONTRIBUTOR
    Posted Jun 30, 2020 02:45 AM
    I did a bit more of digging.

    You can't make the out-of-the-box relationship between business units hierarchical. That option is greyed out. Moreover, it is not possible to create a custom N:1 relationship from business unit to business unit.

    It is possible to create a custom relationship from team and make that hierarchical. E.g. then I could use the default teams created for each business units to create the hierarchy.

    However, I'm still struggling to create a dynamic query that shows opportunities owned by users of the current users team or users of teams below. I can chose the 'under' operator now but then I need to 'hardcode' the team:

    Is there any way, using some FetchXML magic, you can get around this? 


    ------------------------------
    BR,
    Niels
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 7.  RE: View to show records for current user's business unit and child business units

    TOP CONTRIBUTOR
    Posted Jun 30, 2020 06:00 AM
    There are some special options when filtering on a User field. If you filter on the Owner field of the Opportunity (rather than using the Owning User (User) related record) you can use filter types such as "Equals Current User Or User's Teams" - one of these options might work for what you're trying to do.

    ------------------------------
    Mark Carrington
    Chief Technologist
    Data8
    Chester
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 8.  RE: View to show records for current user's business unit and child business units

    TOP CONTRIBUTOR
    Posted Jun 30, 2020 07:25 AM
    Thanks for the input, Mark. I've played around with the different operators but none of them gives me the result I'm looking for.

    ------------------------------
    BR,
    Niels
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role