Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Template Reference Documentation

Contact Template

createOU()

Creates an OU entity

See Also

rb.contact.OUInfo
rb.contact.modifyOU
rb.contact.link
rb.contact.remove

Syntax

number = rb.contact.createOU(values, initialParent)

Parameters

The 'createOU' method takes 2 parameters:

Name Type/Value Range/Length Description
valuesstruct OUDatasee definition Required. New community OU info
initialParentnumberpoitive integer Optional, default = 0
The initial OU parent for this OU. The valid ID of the parent OU, or 0 (root) to indicate that the OU has no parent

Results

The 'createOU' method returns number:

Type/Value Range/Length Description
number -1, or positive integerOU ID of the created OU, or -1 if the OU couldn't be created.

Remarks

If no uName is supplied in the passed data structure then a long machine generated text string is inserted into this field to guarantee uniqueness

A common reason for failure of the create operation is a duplicate uName value already existing in another Individual, Community, or OU entry.

Example

The following creates a new OU for "Mega Corp", and makes the user with uName "fred" a member of the new OU:
	  var mega = new Object;
	  mega.name = "Mega Corp";
	  friends.description = "Mega Corp of Delaware Inc";
	  var newID = rb.contact.createOU(mega);
	  if(newID != null && (user = individualInfo(-1, "fred")))
	  rb.contact.link(user.ID, mega.ID);
	
Whitebeam release 1.3.36
(loadtime : 184ms)