Addressbook.group.addSubgroup
-----------------------------

Adds a subgroup to another group.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Addressbook](component_Addressbook.md) | [3.1](newinversion31.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

### Deprecated

This function was [deprecated](deprecated.md). Use [Contacts](component_Contacts.md) functions instead.

MBS( "Addressbook.group.addSubgroup"; GroupID; SubGroupID ) 

**MBS**( **"Addressbook.group.addSubgroup";** /\* Adds a subgroup to another group. \*/  
**$GroupID**; /\* The unique ID for the target group. \*/   
**$SubGroupID**) /\* The unique ID for the subgroup. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| GroupID | The unique ID for the target group. | $groupID |
| SubGroupID | The unique ID for the subgroup. | $subgroupID |

### Result

Returns 1 for success or 0 for failure on Mac. Returns OK on success and error on failure on iOS.

### Description

Adds a subgroup to another group.  
If the group argument is already part of the group, this method does nothing and returns Failure. If adding the group would create a recursion, this method also does nothing and returns Failure. (For example, if the group Animal Lovers is in Dog Lovers, and you add Dog Lovers to Animal Lovers, that would create a recursion, which this method won't allow.)   
### See also

- [Addressbook.group.addMember](AddressbookgroupaddMember.md)
- [Addressbook.group.parentGroups](AddressbookgroupparentGroups.md)
- [Addressbook.group.removeSubgroup](AddressbookgroupremoveSubgroup.md)
- [Addressbook.group.subgroups](Addressbookgroupsubgroups.md)

This function is free to use.

Created 18th August 2014 , last changed 6th November 2017

  
[Addressbook.group.addMember](AddressbookgroupaddMember.md) - [Addressbook.group.members](Addressbookgroupmembers.md)

[HTML Version](AddressbookgroupaddSubgroup.shtml)