Users related to a particular userGroup

How to get a list of the users in a particular userGroup through code.

p.s- UserGroupInfo table stores names of UserGroups

UserGroupList contains UserId-GroupId relation, so you need just a very simple SELECT.

Hi Martin,

When i install stand alone Ax, after importing AX Demo Data, i synchronize, compile the whole AOT…But when i open Ax, there is no data or empty fields are there…Also while installing Workflow, the status comes as warning and in AX, Administration → Setup → Workflow infrastructure wizard , i click validate and it throws error. I was using windows 2008 server R2… What is the mistake i have done? Can u please help me to find the right solution for this? Any help will be greatly appreciated and thanks in advance

static void userGroupUsers(Args _args)

{

UserGroupInfo userGroupInfo;

UserGroupList userGroupList;

UserInfo userInfo;

;

while select userInfo

join userGroupList where userInfo.Id == userGroupList.UserId

join userGroupInfo where userGroupInfo.Id == userGroupList.GroupId && userGroupInfo.name == “Administrators”

{

info(userInfo.id);

}

}

static void userGroupUsers(Args _args)

{

UserGroupInfo userGroupInfo;

UserGroupList userGroupList;

UserInfo userInfo;

while select userInfo

join userGroupList where userInfo.Id == userGroupList.UserId

join userGroupInfo where userGroupInfo.Id == userGroupList.GroupId && userGroupInfo.name == “Administrators”

{

info(userInfo.id);

}

}