RemoveUsersFromGroup()
A RemoveUsersFromGroup() function removes given users from a chosen group.
RemoveUsersFromGroup(userLogin,groupName);Function arguments
Dział zatytułowany „Function arguments”- userLogin – (String) a login of the user that will be removed from the group. Multiple logins can be passed separated by , or ; or as an ObjectList with users logins;
- groupName – (String) a name of the group to remove users from.
Return value
Dział zatytułowany „Return value”This function returns Boolean. The RemoveUsersFromGroup() function returns true if the user is added to the group successfully, otherwise false.
Examples
Dział zatytułowany „Examples”Example 1
Dział zatytułowany „Example 1”This will remove a user selected in the „User” field on the form from „Managers” group.
RemoveUsersFromGroup([User],"Managers");Example 2
Dział zatytułowany „Example 2”This will remove specified users with „user1” and „user2” logins from „Managers” group.
RemoveUsersFromGroup("user1;user2","Managers");Example 3
Dział zatytułowany „Example 3”This will remove users selected in „User” field/column in a table named „Users list” on the form from „Managers” group. The object list is used in this example.
usersList=CreateObject("ObjectList");foreachrow("Users list"){ AddObjectToList(usersList, [User]);}RemoveUsersFromGroup(usersList,"Managers");