The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Export content by API

Hello, I’m writing a program to export content package from M-Files.
  1. Is it possible to use API to start existing configured scheduled export job?
  1. If above is not possible, how to destroy the object after content is exported? Below setting (MFExportContentFlagDestroyAfterExport) is not working. Content is exported but files still exist in the vault.

        Dim oExportContentJob As New MFilesAPI.ExportContentJob

        oExportContentJob.ConfigurationID = "ExportArchive1"

        oExportContentJob.TargetLocation = ExportFolder

        oExportContentJob.UseSearchConditions = True

        ' Only export with property Can Archive = true

        Dim oSCs As New MFilesAPI.SearchConditions

        Dim oSC As New MFilesAPI.SearchCondition

        oSC.ConditionType = MFilesAPI.MFConditionType.MFConditionTypeEqual

        oSC.Expression.DataPropertyValuePropertyDef = oVault.PropertyDefOperations.GetPropertyDefIDByAlias("PD.CanArchive")

        oSC.TypedValue.SetValue(MFilesAPI.MFDataType.MFDatatypeBoolean, True)

        oSCs.Add(-1, oSC)

        oExportContentJob.SearchConditions = oSCs

        ' Destroy after export

        oExportContentJob.Flags = MFilesAPI.MFExportContentFlag.MFExportContentFlagDestroyAfterExport

        oVault.ManagementOperations.ExportContent(oExportContentJob)

 

Reference: M-Files API - MFExportContentFlag Enumeration

Parents Reply Children
No Data