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

DEVELOPERS FORUM - Vault file from IOM with vb.net

Thobbe - Tuesday, March 19, 2013 7:43 AM:

Hi all experts
This is my first post here.
I have tried to understand Aras and I just think it's awesome program.
I'm trying to vault a file with this code but always get this result:
Error: Failed to obtain vault URL for vault with ID='67BBB9204FE84A8981ED8313049BA06C'

I have read and tried every thing on the Internet but posts on this is for older IOM.DLL

I'm running 9.3

Any help would be very appreciated.

Cheers!

        Dim MyItem As Aras.IOM.Item = MyInnovator.newItem("User", "get")
        MyItem.setAttribute("where", "login_name='admin'")
        MyItem.setAttribute("select", "default_vault")
        Dim MyResult As Aras.IOM.Item = MyItem.apply()

        If MyResult.isError() Then
            msgBox.AppendText(" Query Error: " & MyResult.getErrorDetail())
            Return
        End If
        Dim vDefaultVault As String = MyResult.getProperty("default_vault")
        
        Dim EDdocItm As Aras.IOM.Item = MyItem.newItem("Document", "edit")
        EDdocItm.setAttribute("where", "[DOCUMENT].ITEM_NUMBER='112' and [DOCUMENT].IS_CURRENT='1'")
        EDdocItm.setProperty("Description", "Test2")
        Dim size As Long = File.OpenRead("C:Users plinthoDocuments est.txt").Length
        Dim fileItm As Aras.IOM.Item = MyItem.newItem("File", "add")
("Located", "add")
        fileItm.setProperty("filename", "test.txt")
        fileItm.attachPhysicalFile("C:Users plinthoDocuments est.txt", vDefaultVault)

        fileItm.setProperty("file_type", "F2B9580CB239419A8CB12A02E4FC6962")
        fileItm.setProperty("file_size", size)

        Dim Res As Aras.IOM.Item = fileItm.apply()
        If Res.isError Then
            msgBox.AppendText(" Query Error: " & Res.getErrorDetail())
            Return
        End If



Thobbe - Thursday, March 21, 2013 4:43 AM:

My bad.

I was using a template project that used old IOM.DLL

Changed the project and got other messages now so, I take baby steps forward ;-)

 

Cheers!