Disassociates an entity (OU or individual) from a parent OU or a community
number = rb.contact.unlink(target, container)
The 'unlink' method takes 2 parameters:
|Name ||Type/Value ||Range/Length ||Description |
|target||number||integer, valid ID ||Required. The ID of the OU or individual to be removed|
|container||number|| ||Required. The ID of the community or OU to remove target from.
The 'unlink' method returns number:
|Type/Value ||Range/Length ||Description |
||-1, positive integer||ID of unlink entity, or -1 on failure|
When unlink is used to remove an association to an OU, in doing so it will remove any community or OU memberships which have been inherited from that OU
For example take the individual "fred":
- "fred" is linked to parent OU "engineering"
- OU "engineering", is linked to parent OU "Mega Corp"
- OU "Mega Corp" linked to community "customers"
- "fred" is also linked directly to community "friends"
"fred" is therefore a member of "engineering", "Mega Corp", "customers", and "friends"
Fred leaves Mega Corp and unlink is used to remove fred engineering, this unlink removes his membership of "engineering", "Mega Corp", "customers", but his membership of "friends" is retained.
The following unlinks the user "fred" from the OU "mega"
fred = rb.contact.individualInfo(-1, "fred");
mega = rb.contact.OUInfo(-1, "mega")
if(rb.contact.unlink(fred.ID, mega.ID) < 0))
rb.page.write("unlink returned error");