Alfasith AX

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

Tuesday, June 24, 2014

Job to print all the roles in Dynamic AX

Hi,

static void AlfasithTotalRolesInAX(Args _args)
{
    SecurityRole        role;
   while select role order by Role.Name asc
    {
        info(strFmt("%1 --- %2",Role.Name,Role.RecId));
    }
    pause;

}

Regards,

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,

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...