AnsweredAssumed Answered

Get Latest

Question asked by Steve Anderson on Apr 22, 2019
Latest reply on Apr 22, 2019 by Steve Anderson

I am trying to do a GetLatest on a single file.  There will be many single files, but there is already traversal happening for other reasons, so this is ok,


It looks like it prefers IEdmVault5 over IEdmVault8.  Current global vault variable is IEdmVault8.


Not sure if or why I need batchget (bg), since the fpath will be run as many times as needed and contain the proper path name.  Also, not sure why I need IEdmFolder9 when the path name includes this information.



    Private Sub GetLatest(fPath As String)

        Dim eFile12 As IEdmFile12 = VAULT.GetFileFromPath(fPath)

        Dim eFolder9 As IEdmFolder9

        Dim ePos5 As IEdmPos5 = eFile12.GetFirstFolderPosition

        eFolder9 = eFile12.GetNextFolder(ePos5)


        Dim vault5 As IEdmVault5 = DirectCast(VAULT, IEdmVault5)


        Dim files(0) As EdmSelItem

        files(0).mlDocID = eFile12.ID ' Get File ID

        files(0).mlProjID = eFolder9.ID ' Get Folder ID file is in


        Dim bg As IEdmBatchGet = vault5.CreateUtility(EdmUtility.EdmUtil_BatchGet)


        bg.AddSelection(vault5, files) ' The Hang up happens here: 'The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))'

        bg.CreateTree(0, EdmGetCmdFlags.Egcf_Nothing)

        bg.GetFiles(0, Nothing)


    End Sub


Thanks for the help!