scenario: To get the latest session id of a user ,if multiple client sessions(multiple session id's)exists.
solution:
// #! INCIDENT !#.LAST.18.02.16.Naresh.D
static void latestSessionID(Args _args)
{
SysClientSessions sysClientSessions;
UserInfo userinfo;
select firstonly sysClientSessions order by LoginDateTime desc
join userinfo where userinfo.id == curUserId()
&& sysClientSessions.sid == userinfo.sid;
info(strFmt("%1",sysClientSessions.SessionId));
}
*This post is locked for comments
I have the same question (0)