Security Role with Task Description in AX by X++ Job

Security Role with Task Description in AX by X++ Job.

Below code displays Role and its Task Description and its useful to administrator before you assign any role to end user.

Create below query before writing job


static void ShyamJob4SecurityRolewithTaskDesc(Args _args)
{
    securityRole    sr;
    SecurityTask    st;
    str txt;
    Query qr = new Query(queryStr(S_SecurityRoleDuty));
    QueryRun    qrun = new QueryRun(qr);

    while(qrun.next())
    {
        st = qrun.get(tableNum(SecurityTask));
        sr = qrun.get(tableNum(securityRole));

        txt = SysLabel::labelId2String(st.name, 'en-gb');
        info(sr.Name +'-' + txt);
    }

}

Comments

Post a Comment