xSession.userId Method [AX 2012]
Retrieves the user ID that this session is logged on with.
The following example determines whether a particular user is online.
server static boolean isUserOnline(userId userId)
{
xSession session;
int counter;
int maxSessions = Info::licensedUsersTotal();
if (!userId)
{
return false;
}
for(counter = 1; counter < maxSessions;counter++)
{
session = new xSession(counter, true);
if(session && session.userId() == userId)
{
return true;
}
}
return false;
}
Community Additions
ADD
Show: