Print

RemoveUsersFromGroup()

A RemoveUsersFromGroup() function removes given users from a chosen group.

Syntax

RemoveUsersFromGroup(userLogin,groupName);

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

This function returns Boolean.
The RemoveUsersFromGroup() function returns true if the user is added to the group successfully, otherwise false.

Examples

Example 1

This will remove a user selected in the „User” field on the form from „Managers” group.

RemoveUsersFromGroup([User],"Managers");

Example 2

This will remove specified users with „user1” and „user2” logins from „Managers” group.

RemoveUsersFromGroup("user1;user2","Managers");

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");

 

Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?