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 NAV (Archived)

User security ID

(0) ShareShare
ReportReport
Posted on by

Hi All,

I want to get information from table User Group Members.

I defined a record variable (UserGroupMember) for this table and try the next function:

UserGroupMember.GET('VERKOPERS',SID(USERID),COMPANYNAME)

This give me an error:

Invalid form of GUID string

Any help is welcome,

Thanks,

Patrick

 

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    what is the table id of User Group Members?

  • Community Member Profile Picture
    on at

    9001

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi,

    The Result of SID(USERID) will get the Windows Security ID but

    what the Table User Group Member is Looking a Different Security ID which was automatically Generated When you create a New User.

    ** The Field is Mapped To User Table (2000000120) Field - User Security ID.

    I hope you understand my point. You are trying to assign Wrong Value in Get Statement.

  • Community Member Profile Picture
    on at

    Hi Saurav,

    Ok.  But how do I get the information I need?

    In need the User Security ID of the current user.

    With that I can query table User Group Members.

    Thanks,

    Patrick

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi Patrick,

    Try This -

    User1.Setrange("Windows Security ID",SID(USERID));

    IF User1.FindFirst Then

    UserGroupMember.GET('VERKOPERS',User1."User Security ID",COMPANYNAME)

    Where User1 - is a variable of Table 2000000120.

  • Community Member Profile Picture
    on at

    Saurav,

    It's not a windows user. So I think I cannot use this function?

    User1.Setrange("Windows Security ID",SID(USERID));

    Thanks,

    Patrick

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    In That Case You Cannot use SID(UserID).

    Then Try This -

    User1.Setrange("user Name",YourUserName);

    IF User1.FindFirst Then

    UserGroupMember.GET('VERKOPERS',User1."User Security ID",COMPANYNAME)

    Where User1 - is a variable of Table 2000000120.

    and YourUserName - is the Username that you have given While Creating User.

  • Community Member Profile Picture
    on at

    Suarav,

    I think this will solve the problem but I have one more question.

    How do I get YourUserName: the name of the user currently logged in?

    Thanks,

    Patrick

  • Verified answer
    Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi,

    When You User USERID, Your get the User Name that is in the User table.

    Read C/AL Help for USERID, it says so.

  • Suggested answer
    4BzSoftware Profile Picture
    6,073 on at

    Hi Patrick,

    Is it what you need?

    //gRec_User is record variable, table 2000000120 - User:

    IF gRec_User.GET(USERSECURITYID) THEN

     MESSAGE('%1 %2', gRec_User."User Name", gRec_User."Full Name");

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 NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans