Friday, January 13, 2017

x++ code to find current role of a user in Ax 2012

static void UserRoleAssigninfo1(Args _args)
{
    SecurityRole        role;
    SecurityUserRole    userRole;
    UserInfo            userInfo;
    ;


    select firstonly  role
    exists join userRole
    where role.RecId     == userRole.SecurityRole
        && userRole.User == curUserId();
    
    info(strFmt("%1  -  %2", role.Name,curUserId()));


}

No comments:

Post a Comment

Export a copy of the standard user acceptance testing (UAT) database

 Reference link: Export a copy of the standard user acceptance testing (UAT) database - Finance & Operations | Dynamics 365 | Microsoft ...