How to retrieve login user information?

ahirubbahirubb Member Posts: 5
Since I need to modify the program so that users of a certain responsibility center will use a different set of Number Series for the Purchase order/Sales Invoice, therefore, I need to get the information of the currently logged on user, to check the responsibility center of the user to decide on which Number Series to use.

I've read some previous post saying there's a Session table, but I can't find it in the object list. Can anyone please provide information, or codes to help me out?

Million Thanks.

Comments

  • kinekine Member Posts: 12,562
    1) User login is in USERID
    2) Responsibility center for this user is in table USER
    3) Check this standard code on for example sales order form:
    IF UserMgt.GetSalesFilter() <> '' THEN BEGIN
      FILTERGROUP(2);
      SETRANGE("Responsibility Center",UserMgt.GetSalesFilter());
      FILTERGROUP(0);
    END;
    
    You can see how to get Responsibility center filter - UserMgt.GetSalesFilter()
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.