Skip to main content

Posts

Showing posts with the label Restrict multiple user login

How to Put single user restriction in MSD Axapta application

How to Put single user restriction in Axapta application After writing code to restrict multiple user login you may face problem to login for admin group to resolve that problem you need to give full right for current client session table. this will come on following path. Navigation Pane -> Administration -> Setup -> User Group -> select user group -> Permission -> Permission tab -> select viewing as SECURITY (INCL. WEB) -> Administration -> Tables -> Current Client Sessions.

Code to Restrict multiple user login in axapta

I need help to get solution for following problem if you have idea then reply me your response. I am using following code in info class void startupPost() { // To restrict user login form second login xSession session; SysClientSessions SysClientSessions; UserId currentUserId; int counter; ; currentUserId = curUserId(); if(currentUserId!="Admin")// Allow Admin User 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("The same user can't log in twice."); infolog.shutDown(true); } } As I am working for case We need code to allow open only one instace per user at a time except admin login. I  implemented code in a