Tuesday, August 20, 2019

get a list of Dynamics Ax security roles in code x++

static void FCH_SecurityRole(Args _args)
{
    SecurityRole        role;
    SecurityUserRole    userRole;

    while select userRole
    {
        info(userRole.User);

        select firstOnly role where role.RecId == userRole.SecurityRole;

        info(strFmt('%1 - %2', userRole.SecurityRole, SysLabel::labelId2String(role.Name)));

        info('--------------');
    }
}

No comments:

Post a Comment