2 Replies Latest reply on Dec 6, 2015 9:02 PM by James D

    EPDM, Getting latest on actual folders

    James D

      Hello swForums!

       

      Ok, Here's the deal;

      There's this mostly empty folder structure in our EPDM Vault that gets programmatically copied a lot.

      But since the folder structure gets changed from time to time there needs to be a way to get latest on it before hand.

       

      And I did that with this:

       

      Private Vault As IEdmVault15 = New EdmVault5
      
           Private Sub FolderUpdater(ByVal FolderList As String())
      
              'Select Folders
              Dim i As Integer = FolderList.Count
              Dim Directory(i) As EdmSelItem
      
              For Each Folder As String In FolderList
                  i = i - 1
                  Directory(i).mlDoID = 0 
                  Directory(i).mlProjID = Vault.GetFolderFromPath(Folder).ID
              Next
      
              Try 'Update Folders
                  Console.Write("Getting Latest...      ")
                  Dim BG As IEdmBatchGet
                  BG = Vault.CreateUtility(EdmUtility.EdmUtil_BatchGet)
                  BG.AddSelection(Vault, Directory)
                  BG.CreateTree(0, EdmGetCmdFlags.Egcf_Nothing)
                  BG.GetFiles(0, Nothing)
                  Console.WriteLine("Update Complete!")
              Catch ex As Runtime.InteropServices.COMException
                  Console.WriteLine("HRESULT = 0x" + ex.ErrorCode.ToString("X") + vbCrLf + ex.Message)
              Catch ex As Exception
                  Console.WriteLine(ex.Message)
              End Try
           End Sub
      

       

      The problem is that this method fails to get newly added empty folders or update folders that have had their names changed.

      (It also fails to update files that have been deleted and re-added).

       

      Any suggestions would be really awesome!