// Create table with fields UserId, AllowedSessions (number of allowed sessions for user)
// Add at the beginning of method AppComponent.handleStartupEvent()
#define.SessionsAllowed(3)
SysClientSessions clientSessions;
;
select count(RecId) from clientSessions
where clientSessions.UserId == curuserid()
&& clientSessions.Status == 1
&& clientSessions.ClientType == 0;
if (clientSessions.RecId > #SessionsAllowed)
{
box::stop(strfmt("%1 is only allwed %2 AX Client Sessions. AX Client will close now.",
xUserInfo::find().name, #SessionsAllowed), "AX Client Sessions exceeded");
appl.globalCache().set(classstr(Info),identifierstr(Autologoff), true);
info = new Info();
info.shutDown(true);
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.