Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CheckinFile provides error 1022 (SelfDependency)

1 REPLY 1
SOLVED
Reply
Message 1 of 2
ewcv
923 Views, 1 Reply

CheckinFile provides error 1022 (SelfDependency)

Hi,

my procedure of updating an UPD of a file works in the most cases,

but in some cases CheckinFile provides error 1022 (SelfDependency)

"Error retuned from Vault Server: SelfDependency   System.Web.Services.Protocols.SoapException: 1022 ..."

I don't know why, has anone an idea?

 

my code:

System.Byte[] fileContents;
// long m_nIdDoc is the Id of my file and m_nIdDocMaster is the associated Masterid
AWeb.Folder[] folders = m_ServiceManager.DocumentService.GetFoldersByFileMasterId(m_nIdDocMaster);
if (folders != null && folders.Length > 0)
{
    string sDirectory = Environment.CurrentDirectory;
    bool bEnv = m_ServiceManager.DocumentService.GetEnforceWorkingFolder();
    if (bEnv == true)
        sDirectory = m_ServiceManager.DocumentService.GetRequiredWorkingFolderLocation();
    AWeb.File fileM = m_ServiceManager.DocumentService.CheckoutFile(folders[0].Id, m_nIdDoc, AWeb.CheckoutFileOptions.Master, Environment.MachineName, sDirectory, "comment", false, false, out fileContents);
    try
    {
        m_ServiceManager.DocumentService.UpdateFileProperties(new long[] { m_nIdDocMaster }, new long[] { 104 }, new object[] { "my comment" });
    }
    catch (Exception ex)
    {
        sMessage = CommonFunctions.getErrorAndRestrictionCodesString(ex);
        try
        {
            m_ServiceManager.DocumentService.UndoCheckoutFile(m_nIdDocMaster, false, out fileContents);
        }
        catch {}
    }
    try
    {
        AWeb.FileAssocParam[] assocsParam = getFileAssocParam(m_nIdDocMaster, m_ServiceManager, ref sMessage);
        m_ServiceManager.DocumentService.CheckinFile(m_nIdDocMaster, "my comment", false, DateTime.Now, assocsParam, null, true, fileM.Name, fileM.FileClass, fileM.Hidden, null);
    }

    catch (Exception exCheckin)
    {
        sMessage = CommonFunctions.getErrorAndRestrictionCodesString(exCheckin);
        m_ServiceManager.DocumentService.UndoCheckoutFile(m_nIdDocMaster, false, out fileContents);
    }

 

 

1 REPLY 1
Message 2 of 2
Redmond.D
in reply to: ewcv

Self dependency probably means you are trying to set file X as a dependency or attachment of file X, which is logically impossible.

Take a closer look at assocsParam to make sure the association points to a different file than the one you are updating.



Doug Redmond
Software Engineer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report