Community
Vault Forum
Welcome to Autodesk’s Vault Forums. Share your knowledge, ask questions, and explore popular Vault topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault API Issue - Link Item to file

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
656 Views, 0 Replies

Vault API Issue - Link Item to file

We are trying to link Item to file with API. However, we ran into an issue as described below.

 

 based on the imported data, bulk import and create the item. First Item title such as KG-078 023-Y, then associate the file KG-078023.dwg in Vault to create the link, there is no problem in this step; under an item title for KG-078 023-Z is different version from the previous version of the same item, it uses the same method associated files KG-078023.dwg throws SoapException (call itemSvc.ReassignComponentsToDifferentItems throw.), no other message. A total of thousands of items, there are probably dozens of such item failed because of this reason, the file cannot be associated. Create and relate documents with the following code

 

ItemsAndFiles promoteResult = null;
        Item[] updatedItems = null;
        try
        {
            // first assign the file to a new item
            promoteResult = itemSvc.PromoteFiles(new long[] { selectedFile.Id });

            // next reassign the file from the new item to the existing item
            updatedItems = itemSvc.ReassignComponentsToDifferentItems(
            new long[] { promoteResult.ItemRevArray[0].Id },
            new long[] { selectedItem.Id });

            // commit the changes
            itemSvc.UpdateAndCommitItems(updatedItems);
        }

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report