RelationshipCol Insert Method

Meta Data Services Programming

Meta Data Services Programming

RelationshipCol Insert Method

This method adds a relationship to the collection at a specified point in the collection sequence. The new relationship connects the repository object to the source object of the collection. The new relationship is passed back to the caller.

Syntax

Set variableobject.Insert(reposObj, index, objName)

The Insert method syntax has the following parts.

Part Description
variable A variable declared as a relationship. It receives the new relationship that is created for the reposObj repository object.
object An object expression that evaluates to a RelationshipCol object.
reposObj The repository object whose relationship is to be added to the collection.
index The index of the sequence location where the relationship is to be inserted. If another relationship is already present at this sequence location, the new relationship is inserted before the existing relationship.
objName The name that the new relationship is to use for the reposObj object. This parameter is optional.
Remarks

Relationships may be inserted into a collection only if the collection's source object is also the collection's origin object.

This method can be used only for collections that are sequenced.

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

You can use this method to insert 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 fails. 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.

See Also

RelationshipCol Object