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: 

UpdateAndCommitItem Error 1306

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
442884080
322 Views, 2 Replies

UpdateAndCommitItem Error 1306

Hello,

I am using the Vault2019 API to generate an item,
An error occurred while executing UpdateAndCommititems() with prompt 1306.

var itemNum = ItemSvc.AddItemNumbers(new[] { item.MasterId }, new[] { numSchm.SchmID }, new[] { new StringArray() }, out var restrics);
ItemSvc.CommitItemNumbers(new[] { item.MasterId }, new[] { item.ItemNum });
item.ItemNum = itemNum.First().ItemNum1;
item.Title = drawingName;
item.Detail = deviceSpec;
itemNumStr = item.ItemNum;
ItemSvc.UpdateAndCommitItems(new[] { item });
2 REPLIES 2
Message 2 of 3
Nick_Hall
in reply to: 442884080

Hi

 

I use something like this to create an item

// long catId is the Category ID for the new item
// string itemNumber is the Number for the new item
// string title is the Title for the new item
// long numSchmId is the Numbering Scheme ID for the new item

ACW.Item newItem = ItemSvc.AddItemRevision(catId);
ACW.StringArray[] fieldInputs = new ACW.StringArray[1];
ACW.StringArray sarray = new ACW.StringArray
{
    Items = new string[] { itemNumber }
};
fieldInputs[0] = sarray;
ACW.ItemNum[] itemNum = ItemSvc.AddItemNumbers(new long[] { newItem.MasterId },
    new long[] { numSchmId },
    fieldInputs,
    out ACW.ProductRestric[] restrictions);
newItem.ItemNum = itemNum[0].ItemNum1;
newItem.Title = title;
newItem.NumSchmId = numSchmId;
ItemSvc.UpdateAndCommitItems(new ACW.Item[] { newItem });

 

It should work with Vault 2019

 

Hope it helps

Nick

Message 3 of 3
442884080
in reply to: Nick_Hall

Thank you Nike,
I found the problem, it's because the Detail attribute of the item gave a null value, so there was an error during submission
Thank you again.

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

Post to forums  

Autodesk Design & Make Report