Workspace CreateObject Method

Meta Data Services Programming

Meta Data Services Programming

Workspace CreateObject Method

This method creates a new RepositoryObject of the specified type. After you create a new object, you must include it in the workspace.

This method is not attached to the default interface for the repository Automation object; it is attached to the IRepositoryObjectVersion interface. For more information about accessing a member of an interface that is not the default interface, see Accessing Automation Object Members.

Syntax

Set variable  =  object.CreateObject(typeId, objectId)

The CreateObject method syntax has the following parts.

Part Description
variable Declared as a RepositoryObject. It receives the new repository object.
object The object that represents the workspace through which this program is interacting with the repository.
typeId The type of the new object; that is, the object identifier of the object definition to which the new object conforms.
objectId The object identifier to be assigned to the new object. To have the repository engine assign an object identifier for you, pass in ObjID_NULL or do not supply this optional parameter.
Remarks

This method creates a new object in the repository, but it does not insert the newly created object into the workspace in whose context you are operating.

This method can only be called from the shared repository but not from a workspace. The workaround is to create the object through the central repository and include it in the workspace.

See Also

RepositoryObject Object

Workspace Object