I am running code to clean up items, their attachments and their BOM in Vault 2012 Professional. After I run the code, the items end up with several system properties being blank including Category Name, Property Compliance, Revision Scheme and Type. "Historical" versions of those properties (where they exist) do show the correct value. Subsequently editing and releasing records by hand results in all the properties being populated properly once again.
Any idea what might be causing this? Thanks.
Hello fnacer,
Could you provide more details as to what you mean when you say you're running code to update items? A more detailed description of what your code is doing including what web service methods you're using or an example code snippet would be helpful.
Thanks
The code does the following:
1) Take item to Work in Progress
2) Remove all attachments
3) Edit selected user-defined properties
4) Remove selected items from the BOM
5) Associate new user-defined properties
6) Attach files
7) Return the item to its original lifecycle state
The code is running against Vault Pro 2012 and uses the web service API (e.g., ItemService, DocumentService, etc.). Here's an edited sample of the code I am using for step #1 and #7:
Item[] itemsToEdit = itemSvc.EditItemLifeCycleStates(new long[] { id });
ProductRestric[] primaryRestrictions;
ProductRestric[] warnings;
ProductRestric[] optionalRestrictions;
Item[] optionalItems;
Item[] editedItems = itemSvc.UpdateLifeCycleStates(new long[] { itemsToEdit[0].Id }, lifeCycleId, false,
out primaryRestrictions, out warnings, out optionalRestrictions, out optionalItems);
itemSvc.UpdateAndCommitItems(editedItems);
None of my code does anything explicit with Category Name or the other system properties I am having trouble with. But since manually changing the item's lifecycle to WIP and back to Release appears to restore the property values, perhaps you could suggest the right code to do that. Thanks.