Wednesday, 8 November 2017

To get the list of Roles assigned to users in AX 2012

we can fetch the required data from Two tables with the help of a small job.
Tables :  SecurityRole & SecurityUserRole



static void SecurityRole(Args _args)
{
  SecurityRole          securityRole;
  SecurityUserRole     securityUserRole;
  
    while select RecId,name from securityRole   
    join securityUserRole   
    where securityRole.RecId == SecurityUserRole.SecurityRole   
    //&& SecurityUserRole.User == curUserId() //for current user roles
    {
      info(strFmt("%1 - %2",SecurityUserRole.User,securityRole.name));
    }
}

No comments:

Post a Comment

POSTMAN D365

  Postman is useful to test the behavior of different OData class from/to D365FO. In this post we will see the steps to setup Postman with D...