M-Files API 23.11.13135.0
ObjectClass Object
Members 
Description
The ObjectClass class represents an object class.

Object classes are used for categorizing objects. The class of an object determines which metadata should be specified for the object. An object class automatically provides the object with certain properties that have been specified for the object class. Some of these properties are obligatory and must be filled in while creating a new M-Files object of this class, whereas others accept an empty (NULL) value.

Public Methods
Creates a copy of the object.
Public Properties
The ACL that defines the visibility and other permission settings of this object class. Also specifies who can attach objects to this class.
The additional type-specific class features.
The associated property definitions of the class.
Specifies the automatic permissions for an object for which the user selects this item. If Nothing, no automatic permissions are defined.
Specifies whether the object class is the default class of the object type.
Specifies whether the use of the specified workflow is forced.
The ID of the class.
The name of the class.
The ID of the property definition that represents the name of the document or other object.
The object type with which this class is used.
The default workflow of the class, or zero if there is no default workflow.
Remarks

Object classes can be accessed by using the VaultClassOperations interface.

The object class of a vault object is part of the object's metadata and it is stored in the object version as a property value. See the example below for resolving the object class for a vault object.

 

 

Object classes in M-Files Admin.

Example
' Identify the object.
Dim oObjVer As MFilesAPI.ObjVer
'...

' Get the value of class property.
Dim oPropertyValues As MFilesAPI.PropertyValues = oVault.ObjectPropertyOperations.GetProperties(oObjVer)
Dim oPropertyValue As MFilesAPI.PropertyValue = oPropertyValues.SearchForProperty( _
    MFilesAPI.MFBuiltInPropertyDef.MFBuiltInPropertyDefClass)

' As this is class property, the data type is always "Lookup value".
If oPropertyValue.TypedValue.DataType <> MFilesAPI.MFDataType.MFDatatypeLookup Then
    Throw New SystemException("Internal error")
End If

' The value of lookup item is the class id. Resolve the class object.
Dim iClassId As Integer = oPropertyValue.TypedValue.GetLookupID()
Dim oObjectClass As MFilesAPI.ObjectClass = oVault.ClassOperations.GetObjectClass(iClassId)

' Resolve the class name.
Dim szClassName As String = oObjectClass.Name
See Also

ObjectClass Members  | ClassGroup Object