How to get No of users Online and sessions

This job gives you the number of current online users.

static void noofusersOnline(Args _args)
{
int maxSessions = Info::licensedUsersTotal();
userinfo userinfo;
int counter;
int num;
xSession session;

if (!maxSessions) //Demo mode
maxSessions = 3;

num = 0;
for(counter = maxSessions;counter;counter--)
{
session = new xSession(counter, true);
if(session && session.userId())
{
select userinfo where userinfo.id == session.userId();
print userinfo.name;
}
}
print "Maximum session id's in Axapta - ", xsession::maxSessionId();
pause;

}

1 comment:

  1. We composed these questions or feature list based on our interactions with several ERP customers who are using Interprise or other various ERP software’s such as Everest.

    Online ERP Demo

    ReplyDelete

Note: Only a member of this blog may post a comment.