Thursday, September 10, 2015

How to fetch the UserGroup and Permissions Using X++ in AX 2009



static void Esh_UserGroup(Args _args)
{

 AccessRightsList accessRightsList;
 UserGroupList  userGroupList;
 UserGroupInfo userGroupInfo;
 UtilIdElements utilIdElements;
 ;

 while select UserGroupList
 join UserGroupInfo
 where UserGroupInfo.Id == UserGroupList.groupId
 join AccessRightsList
 where AccessRightsList.groupId == userGroupInfo.id

 {
  select * from utilIdElements;
  {
  info(strFmt("%1,%2,%3,%4", userGroupList.userId,userGroupList.groupId,accessRightsList.accessType, accessRightsList.elementName));
  }
 }


}

====================================================================


static void Esh_MenuItems(Args _args)
{
 AccessRightsList accessRightsList;
 UserGroupList  userGroupList;
 UserGroupInfo userGroupInfo;
 UtilIdElements utilIdElements;
 ;

while select UserGroupList
 join UserGroupInfo
 where UserGroupInfo.Id == UserGroupList.groupId
 join AccessRightsList
 where AccessRightsList.groupId == userGroupInfo.id
{
select * from utilIdElements;
 {
 Info(strFmt("%1,%2",userGroupInfo.id,accessRightsList.elementName));
  }
}
}

1 comment:

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// &l...