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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to pass curuserid to SSRS report ?

(0) ShareShare
ReportReport
Posted on by

I'm looking at using DataMethods to pass the curuserid as a parameter to filter a dataset on the current user. How to do that ?

For now when I need this, I'm creating an action item menu that launches a class. This class feeds the curuserid as a parameter before launching the actual output menu item.

I'm trying to see if it could be simplified by getting the current user directly from within a data method. For now even if I create a Data Method that returns an hardcoded string it seems I can't feed a parameter (either the value or the allowed values) with a datamethod.

Are datamethod onyl usable as data sources for the report but not as a source for parameters ?

Thankds in advance (using Reporting Services 2005).

 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    I believe I've got found now a better approach. Rather than trying to feed a SQL Server query with the curuserid parameter I'm just using a business logic method to execute the statement I need filtered based on the curuserid. I'm using this already filtered list as a source for one of my parameter...

  • Verified answer
    Community Member Profile Picture
    on at

    Why not just use

    =User!UserID

    within the report?

  • Community Member Profile Picture
    on at

    It doesn't seems there is a User object or do you mean Globals!UserId ?

    As it is part of the RS programming model even outside of an AX context, I assumed it returned the Windows account name under which the report runs. I needed the AX user identifier.

    I'll give this a try though to see what is the result. Thanks.

  • Verified answer
    Community Member Profile Picture
    on at

    Yes, you are correct, this will give you windows account name.  However, you can create a new dataset in ssrs to query AX table UserInfo based on the NetworkAlias field and have it return userinfo.id which is the AX user name.

    Depending on how you have everything setup, networkalias field should equal windows account.

  • Community Member Profile Picture
    on at

    Ok thanks I'll give this handy depending on what I'm doing. I've got now at least 2 solutions I'm pleased with...

  • MS SSRS Profile Picture
    15 on at

    I want to get the name associated with this UserID. Please help me with that

  • Suggested answer
    Adrian Pascari A Profile Picture
    1,683 on at

    Use embedded report parameter 'User!UserID'(you'll see it under 'Built-in Fileds'). It is windows account.

    After search in UserInfo Ax table the ax userId(domain in one column, UserId is other column). Open UserInfo table and you'll see the solution - nothing hard.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans