A group of methods for creating and modifying objects.
AddFavorite | Adds the specified object to the 'Favorites' view of the current user. |
AddFavorites | Adds the specified objects to the 'Favorites' view of the current user. |
ChangePermissionsToACL | Changes the permissions for the specified object. |
ChangePermissionsToNamedACL | Changes the permissions for the specified object. |
CheckIn | Checks in the object. |
CheckInMultipleObjects | Checks in multiple objects at once. |
CheckOut | Checks out the object. |
CheckOutMultipleObjects | Checks out multiple objects at once. |
CompareWithAnotherDocument | Compares the content of this document with the content of another one. |
CompareWithAnotherVersion | Compares the content of this document version with the content of another one. Use the CompareWithAnotherVersionEx method for multi-file document support. |
CompareWithAnotherVersionEx | Compares the content of this document version with the content of another one. |
CompareWithPreviousVersion | Compares the content of this document version with the content of the previous one. Use the CompareWithPreviousVersionEx method for multi-file document support. |
CompareWithPreviousVersionEx | Compares the content of this document version with the content of the previous one. |
CopyConflictObjectAsNewVersionToBaseObject | Saves a copy of the deleted conflict object as a new version of the related base object. |
CreateNewAssignment | Creates a new assignment. |
CreateNewEmptySingleFileDocument | Creates a new single-file document based on the specified properties and source files. |
CreateNewObject | Creates a new object based on the specified properties and source files. |
CreateNewObjectEx | Creates a new object based on the specified properties and source files. |
CreateNewObjectExQuick | Creates a new object based on the specified properties and source files. |
CreateNewSFDObject | Creates a new single file object based on the specified properties and source file. |
CreateNewSFDObjectQuick | Creates a new single file object based on the specified properties and source file. |
DelayedCheckIn | Performs check-in operation for the object after any of the object's files are no longer in use. |
DeleteObject | Deletes the specified object. |
DestroyObject | Destroys an object or a specific version of the object. Prefer DestroyObjectEx as its parameter ObjectVersion supports unmanaged external repository objects. |
DestroyObjectEx | Destroys the specified object, or a specific version of the object. |
DestroyObjects | Destroys the specified objects. |
FollowObject | Starts or stops following the specified object. While the object is being followed, the current user will be notified if the object changes. |
ForceUndoCheckout | Performs undo checkout and enforces the operation if the user has permission to perform forced undo checkout. |
GetCollectionMembers | Gets all the collection members of the specified collection. |
GetHistory | Gets the history of the specified object. Use GetHistoryEx for additional options. |
GetHistoryEx | Gets the extended history of the specified object with search parameters. |
GetLatestObjectVersionAndProperties | Gets the latest version and properties of the specified object. |
GetLatestObjVer | Gets the latest version of the specified object. |
GetLatestObjVerEx | Gets the latest version of the specified object. Optionally notifies M-Files windows to update the object in their listings. |
GetLinkURLForObjectOrFile | For the specified object or file, gets a link to a web page that is used to open the item in the preferred M-Files client. |
GetMFilesURLForObject | Gets an M-Files URL for the specified object. |
GetMFilesURLForObjectEx | Gets an M-Files URL for the specified object. |
GetMFilesURLForObjectOrFile | Gets an M-Files URL for the specified object or file. |
GetMFilesURLForObjectOrFileEx | Gets an M-Files URL for the specified object or file. |
GetObjectDataOfMultipleObjects | Receives the requested information of the specified objects. |
GetObjectGUID | Gets the Object GUID of the specified object. |
GetObjectInfo | Gets information on the specified object version. |
GetObjectInfoEx | Gets information on the specified object version. Optionally notifies M-Files windows to update the object in their listings. |
GetObjectLocationsInView | Gets the locations of the object in a view. |
GetObjectPermissions | Gets the permissions for the specified object. |
GetObjectVersionAndProperties | Gets the information on and properties of the specfied object version. |
GetObjectVersionAndPropertiesOfMultipleObjects | Gets the object version and properties of the specified objects. |
GetObjIDByGUID | Gets the Object ID of the object that is identified by the specified Object GUID. |
GetObjIDByOriginalObjID | Gets the Object ID of the object that is identified by the specified Original Vault GUID and Original Object ID. |
GetOfflineAvailability | Gets the offline availability of the specified object. |
GetOfflineObjIDs | Gets the IDs of the objects set to be available offline. |
GetRelatedObjectInfo | Gets information related to the specified lookup property. |
GetRelationships | Gets all the relationships of the specified object. |
GetRelationshipsEx | Gets all the relationships of the specified object. |
GetThumbnailAsBytes | Gets the thumbnail for the specified object in PNG format. |
GetThumbnailOfTypeAsBytes | Gets the classic or preview thumbnail for the specified object in PNG format. |
IsObjectCheckedOut | Checks whether the specified object is checked out to any user on any computer. |
IsObjectCheckedOutToThisUserOnThisComputer | Checks whether the specified object is checked out to this user on this computer. |
IsObjectFollowed | Checks whether the specified object is currently followed by the current user. |
IsSingleFileObject | Checks whether the specified object version is a single-file or multi-file document. |
MatchesSearchConditions | Checks whether the specified object matches the search conditions. Any field expression in search conditions is not supported. |
MatchesSearchConditionsEx | Checks whether the specified object and properties match the search conditions. Any field expression in search conditions is not supported. |
NotifyObjectAccess | Notifies M-Files that an object has been accessed. This will add the object to the Recently Accessed by Me view of the user. |
ProposeCheckOutForFile | Proposes checkout operation for the object file. System may prompt for checkout. Returns error on cancel. |
RejectCheckInReminder | Prevents implicitly or explicitly triggered checkin reminder from calling process. |
RemoveFavorite | Removes the specified object from the 'Favorites' view of the current user. |
RemoveFavorites | Removes the specified objects from the 'Favorites' view of the current user. |
ResolveConflict | Resolves a conflict that involves the specified participant object. Returns the affected objects. Do not use this method if the vault uses automatic conflict resolution. |
Rollback | Rolls back the specified object to the specified version. Prefer RollbackEx as its parameter RollbackToVersion supports unmanaged external repository objects. |
RollbackEx | Rolls back the specified object to the specified version. |
SetExternalID | Sets the external ID for an object. The object itself must be internal. |
SetObjectGUID | Sets the Object GUID of the specified object. |
SetOfflineAvailability | Marks the specified object for offline availability, or clears the offline availability marker. |
SetSingleFileObject | Changes the single-file status of the specified object. |
ShowBasicEditObjectWindow | Displays the edit object metadata window. |
ShowBasicNewObjectWindow | Displays the new object metadata window. |
ShowChangeStateDialogModal | Displays the 'Change State' dialog box for the object. |
ShowCheckInReminder | Displays the checkin reminder for the specified object. Can fail if the object is open in another program. |
ShowCheckInReminderDialogModal | Displays a modal checkin reminder dialog for the specified object. Does not perform the actual check in operation. Returns error on cancel. |
ShowCheckoutPrompt | Displays the object checkout prompt for the user. |
ShowCollectionMembersDialog | Displays the collection members dialog box for the object. |
ShowCommentsDialogModal | Displays the comments dialog box for the object. |
ShowEditObjectWindow | Displays the edit object metadata window. |
ShowHistoryDialogModal | Displays the history dialog box for the object. |
ShowNewObjectWindow | Displays the new object metadata window. |
ShowPrefilledNewObjectWindow | Displays a new object metadata window. |
ShowRelatedObjects | Shows related objects for the object by target object type in Windows Explorer. |
ShowRelationshipsDialog | Displays the relationships dialog box for the object. |
ShowSelectObjectHistoryDialogModal | Displays the history dialog box for the object. |
ShowSubObjectsDialogModal | Displays the sub-objects dialog box for the object. |
UndeleteObject | Undeletes the specified object. |
UndoCheckout | Performs undo checkout for the specified object version. |
UndoCheckoutMultipleObjects | Performs undo checkout for the specified object versions. |
' Identify the object. Dim oObjVer As MFilesAPI.ObjVer '... ' Get the version data and check if the object version is checked out. If the version is checked out, it must be ' checked out for current user -- otherwise the version wouldn't be visible for the user. Dim oObjectVersionAndProperties As MFilesAPI.ObjectVersionAndProperties = _ oVault.ObjectOperations.GetObjectVersionAndProperties(oObjVer) If oObjectVersionAndProperties.VersionData().ThisVersionCheckedOut() Then ' This object is checked out for current user. End If
' Create property definitions Dim oPropertyValues As MFilesAPI.PropertyValues = New MFilesAPI.PropertyValues ' Add 'Name and Title' property by creating a new PropertyValue object. ' The PropertyValue object encapsulates the metadata information (PropertyDef) ' and the actual value (TypedValue). Dim oPropertyValue1 As MFilesAPI.PropertyValue = New MFilesAPI.PropertyValue oPropertyValue1.PropertyDef = MFilesAPI.MFBuiltInPropertyDef.MFBuiltInPropertyDefNameOrTitle oPropertyValue1.TypedValue.SetValue(MFilesAPI.MFDataType.MFDatatypeText, "DemoObject") oPropertyValues.Add(0, oPropertyValue1) ' Add 'Class' property Dim oPropertyValue2 As MFilesAPI.PropertyValue = New MFilesAPI.PropertyValue oPropertyValue2.PropertyDef = MFilesAPI.MFBuiltInPropertyDef.MFBuiltInPropertyDefClass oPropertyValue2.TypedValue.SetValue(MFilesAPI.MFDataType.MFDatatypeLookup, _ MFilesAPI.MFBuiltInDocumentClass.MFBuiltInDocumentClassOtherDocument) oPropertyValues.Add(1, oPropertyValue2) ' Add 'Single file' property Dim oPropertyValue3 As MFilesAPI.PropertyValue = New MFilesAPI.PropertyValue oPropertyValue3.PropertyDef = MFilesAPI.MFBuiltInPropertyDef.MFBuiltInPropertyDefSingleFileObject oPropertyValue3.TypedValue.SetValue(MFilesAPI.MFDataType.MFDatatypeBoolean, True) oPropertyValues.Add(2, oPropertyValue3) ' Add source file. Dim oSourceFiles As MFilesAPI.SourceObjectFiles = New MFilesAPI.SourceObjectFiles Dim oSourceFile1 As MFilesAPI.SourceObjectFile = New MFilesAPI.SourceObjectFile oSourceFile1.SourceFilePath = "c:\demo.txt" oSourceFile1.Title = "demo" oSourceFile1.Extension = "txt" oSourceFiles.Add(0, oSourceFile1) ' Create new object. Dim oObjectVersionAndProperties As MFilesAPI.ObjectVersionAndProperties oObjectVersionAndProperties = m_vault.ObjectOperations.CreateNewObject( _ MFilesAPI.MFBuiltInObjectType.MFBuiltInObjectTypeDocument, _ oPropertyValues, oSourceFiles) ' Check in the newly created object. m_vault.ObjectOperations.CheckIn(oObjectVersionAndProperties.ObjVer)
' Initialize the API and connect to a vault. Dim oVault As MFilesAPI.Vault ' ... ' We are searching for the document with ID 123. Dim iDocumentId As Integer iDocumentId = 123 ' Initialize an ObjID object for the search. Dim oObjId As New MFilesAPI.ObjID oObjId.SetIDs(MFilesAPI.MFBuiltInObjectType.MFBuiltInObjectTypeDocument, iDocumentId) ' Invoke the search operation. Dim oObjectVersionCheckedOut As MFilesAPI.ObjectVersion Dim oObjectVersionAndProperties As MFilesAPI.ObjectVersionAndProperties oObjectVersionAndProperties = oVault.ObjectOperations.GetLatestObjectVersionAndProperties(oObjId, True) oObjectVersionCheckedOut = oObjectVersionAndProperties.VersionData ' Get the info for all the versions of this document. Dim oObjectVersions As MFilesAPI.ObjectVersions oObjectVersions = oVault.ObjectOperations.GetHistory(oObjId) ' Check if this object version is checked out to the current user. If oObjectVersionCheckedOut.ThisVersionCheckedOut Then Call Console.WriteLine("Document object: '" + oObjectVersionCheckedOut.GetNameForFileSystem() + "' [checked out to me]") Call Console.WriteLine(" Current version: " + CStr(oObjectVersionCheckedOut.ObjVer.Version)) Call Console.WriteLine(" Checked out: " + oObjectVersionCheckedOut.CheckedOutAtUtc + " UTC") ' Try to resolve the previous version number before checkout. If oObjectVersions.Count > 1 Then Dim oObjectVersionOld As MFilesAPI.ObjectVersion = oObjectVersions.Item(oObjectVersions.Count - 1) Call Console.WriteLine(" Latest version before checkout identified by: " + CStr(oObjectVersionOld.ObjVer.Version)) End If Else Call Console.WriteLine("Document object: '" + oObjectVersionCheckedOut.GetNameForFileSystem() + "'") End If ' Resolve the last modification timestamp of the object. Dim dtObjectModification As Date = oObjectVersionCheckedOut.LastModifiedUtc Call Console.WriteLine(" Object modified: " + CStr(dtObjectModification) + " UTC") ' Process the object files. Dim oObjectFiles As MFilesAPI.ObjectFiles = oObjectVersionCheckedOut.Files For Each oObjectFile As MFilesAPI.ObjectFile In oObjectFiles ' Construct the FileVer string for the file. Dim szFileVer = CStr(oObjectFile.ID) + "-" + CStr(oObjectFile.Version) ' Output the identification of the object file. Call Console.WriteLine(" Document file: '" + oObjectFile.GetNameForFileSystem() + "'") ' Resolve the last modification timestamp of the file content. Dim dtContentModification As Date = oObjectFile.LastAccessTimeUtc Call Console.WriteLine(" Currently identified by: " + szFileVer) ' Try to find the previous versions of the object files. If oObjectVersionCheckedOut.ThisVersionCheckedOut And oObjectVersions.Count > 1 Then Dim oObjectFilesOld As MFilesAPI.ObjectFiles = oObjectVersions.Item(oObjectVersions.Count - 1).Files For Each oObjectFileOld As MFilesAPI.ObjectFile In oObjectFilesOld If oObjectFileOld.ID = oObjectFile.ID Then ' Construct the FileVer string for the previous version of the file. Dim szFileVerOld = CStr(oObjectFileOld.ID) + "-" + CStr(oObjectFileOld.Version) Call Console.WriteLine(" Latest version before checkout identified by: " + szFileVerOld) Call Console.WriteLine(" File content modified: " + CStr(dtContentModification) + " UTC") End If Next End If Next