Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Tuesday, June 24, 2014

Job to list out all roles to current user in Dynamic AX

Hi,

static void AlfasithListOutRoles2User(Args _args)
{
    SecurityRole        role;
    SecurityUserRole    userRole;
    boolean             added;
    UserInfo            userInfo;
    ;
    while select * from userRole
            where
                userRole.User == xUserInfo::find().id
    while select role where role.RecId == userRole.SecurityRole
    {
        info(strFmt("%1 --- %2",Role.Name,Role.RecId));
    }
}

Regards,

No comments:

Post a Comment

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...