Hi all,
I see that Sage 200 have this class: Sage.Accounting.User, but how do I get the current user?
Thank you
Sage.Accounting.Application.ActiveUser is obsolete but still works, replaced by ActiveUserNumber and ActiveUserName
But if you need the User object (eg, in POP Authorisation) you can use Sage.Accounting.Application.Users.GetUser(ActiveUserNumber )
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 } } }
*Community Hub is the new name for Sage City