Skip to content

Instantly share code, notes, and snippets.

@ztirom

ztirom/resetUserSession Secret

Last active Apr 22, 2016
Embed
What would you like to do?
Delete WHS Mobile Device Portal User Session in AX2012
private void resetUserSession()
{
WHSWorkUserSession workUserSession;
if (fieldWHSUserId.value())
{
workUserSession = WHSWorkUserSession::find(fieldWHSUserId.value(), true);
if (workUserSession)
{
try
{
ttsBegin;
if (workUserSession.validateDelete())
workUserSession.delete();
else
throw Exception::Error;
ttsCommit;
}
catch (Exception::Error)
{
error(strFmt("Could not delete user session data for userId %1",
workUserSession.UserId));
}
}
else
error(strFmt("UserId %1 not found!",
fieldWHSUserId.value()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment