Hi Folks,
Many times intentionally or unintentionally
a user may open multiple session of AX. That surly impact your performance. So
here is a fix,
1. Go to AOT
2.
Open class ‘Info’
3.
Copy Paste the Following Code in startupPost method.
void startupPost ()
{
// To restrict user login form second login
xSession session;
SysClientSessions SysClientSessions;
UserId currentUserId;
int counter;
;
currentUserId = curUserId();
if(currentUserId!="Admin")// only Admin
User is allowed to login multiple time
{
while select SysClientSessions
where SysClientSessions.userId == currentUserId
&&
SysClientSessions.Status == 1 // 1 : Login 0 :
Logout
{
session = new xSession(SysClientSessions.SessionId,
true);
if (session && session.userId())
{
counter++;
}
}
if(counter>=2)
{
Box::stop("Already Logged-in : The same user id
can't log in twice.");
infolog.shutDown(true);
}
}
}
Please take backup of your application before copying code
-Harry
void startupPost ()
Please take backup of your application before copying code
-Harry