web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How filter the data for SSRS reports using the Business Unit of the current logged in user?

(0) ShareShare
ReportReport
Posted on by

Hi, 

I want to develop SSRS reports where I can filter the records and the data by the Business Unit of the current logged in user. These reports will be displayed on the Dashboard.

Can I get the id of the current logged in user or its business unit in my SQL query at runtime, so that I can use it to filter the records such that when the user of say Business Unit A logs in, he is shown the reports but only with the data relevent to the users of Business Unit A. ?

Please advise. 

Thanks, 
Fahad

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi Fahad,

    If you use the filteredview, actually it will retrieve and return the data based on what the each user can see, it will be managed by Security Role and Business Unit thing.

    So,let's say you use select * from filteredaccount, you set User A to BU A then give access to only BU Access.

    Then the user A when run the report will see all Account under his BU ownership, owned by BU A.

    While, other user, User B can only see records owned by BU-B and System Admin can see all accounts created and owned by any BU.

    Anyway, you can get the current user id (logged used) data from:

    CRM SQL function fn_FindUserGuid.

    crmtipoftheday.com/.../reflecting-current-user-ssrs

    Hope this helps.

    Thanks.

  • Community Member Profile Picture
    on at

    Thanks Aileen,

    Looks good. I will check this as there are some complex reports and will get back here.

    You're a great help :)

    Best,
    Fahad

  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Fahad,

    To create a report in SSRS, this is very important to use the filteredview and also use the CRM SQL built-in function.

    Hope this can solve your problem.

    Thanks.

  • Community Member Profile Picture
    on at

    Hi Aileen,

    Can you please reflect more on filteredview? Does this mean that we filter the date via SQL in SSRS query?

    Best regards,

    Fahad

  • Community Member Profile Picture
    on at

    I want to the records of Incident (Case) based on the BU. There are several BUs and each BU manager needs to see the reports for the records of their own BU.

  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at

    Fahad,

    Yes, as I mentioned before.

    FilteredView will be useful for you to filter the data easily using security role, not parameter at all in the SSRS.

    Thanks.

  • SHRIKANT KARPUR Profile Picture
    250 on at

    can we make it work somehow in VS 2013 BIDS?

  • Suggested answer
    Alagunellaikumar Profile Picture
    6,212 on at

    I think VS2013 BIDS doesn't support for Dynamics CRM report extension. try either VS2012 BIDS or 2015BIDS

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans