How to get current user programmatically?

SOLVED

Hi all,

I see that Sage 200 have this class: Sage.Accounting.User, but how do I get the current user?

Thank you

Parents Reply Children
  • 0 in reply to Geoff Turner

    Thank you Geoff. As I explore more on Sage.Accounting.Application, I ended up with the code below because I need to get the user role as well.

    Sage.Accounting.Role role = Sage.Accounting.Application.Roles.GetRole("Administrators");
    if(role != null)
    {
        foreach (Sage.Accounting.User u in role.Users)
        {
            if (u.UserNumber == Sage.Accounting.Application.ActiveUserNumber)
            {
                //hide button
            }
        }
    }