Community
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 });
Solved! Go to Solution.
Solved by 442884080. Go to Solution.
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
Can't find what you're looking for? Ask the community or share your knowledge.