Create a new group in the repository.

Namespace: Perforce.P4
Assembly: p4api.net (in p4api.net.dll) Version: 2017.3.160.836 (2017.3.160.0836)

Syntax

C#
public Group CreateGroup(
	Group group
)
Visual Basic
Public Function CreateGroup ( _
	group As Group _
) As Group
Visual C++
public:
Group^ CreateGroup(
	Group^ group
)

Parameters

group
Type: Perforce.P4..::..Group
Group specification for the new group

Return Value

The Group object if new group was created, null if creation failed

Examples

To create the group 'Mygroup' with the owner 'Bob' and a users 'Ted' and 'Alex':
CopyC#
string targetGroup = "Mygroup";
Group group = new Group();
group.Id = targetGroup;
group.UserNames = new  List<string> { "Ted", "Alex" };
group.OwnerNames = new  List<string> { "Bob" };
_repository.CreateGroup(group);

See Also