RelationshipCol Add Method

See Also

This method is used to add a new item to a relationship collection, when the sequencing of relationships in the collection is not important. The new relationship connects the reposObj object version to the source object version of the collection. The new relationship is passed back to the caller.

Syntax

Set variable = object.Add( reposObj, objName )

The Add method syntax has the following parts.

Part Description
variable A variable declared as a VersionedRelationship object. Receives the new relationship that is created for the reposObj Repository object version.
object The relationship collection.
reposObj The Repository object version whose relationship is to be added to the collection.
objName The name that the new relationship is to use for the reposObj object version. This parameter is optional.

Remarks

You can add a relationship to a collection only when the collection's source object is also the collection's origin object.

When you call this method, the origin version must be unfrozen.

You can use this method to create a new versioned relationship between the source object version and a version of the target object. You cannot use it to enlarge a versioned relationship. If the source object version already has a relationship to any version of the target object, this method will fail. You can include another version of the target object in the versioned relationship by adding an item to the versioned relationship's TargetVersions collection.

The value of plReposObj is the specific version of the target object.

If you are operating within the context of a workspace, the target object version you specify with plReposObj must be present in the workspace.