- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm hoping someone may be able to help em with an issue I'm having.
In my VP2014 code, I was using the ItemService.UpdateAndCommitItem method to update user properties in an Item by passing in an array of PropInst objects.
With 2016, I assume that I'm supposed to do it differently, using the UpdateItemProperties method in the ItemService.
I'm confused though. The "Vault 2016 API Changes" section in the SDK documentation lists the UpdateItemProperties method as removed!
But the documentation clearly shows it in the ItemService.
Anyway, I get a 3933 Server error code which translates to "UpdatePropertiesFailed" and I don't know why.
Here's my code:
//First I make the item editable editItem = this.m_itemSvc.EditItems(new long[] {item.RevId})[0]; //Then I create a list of PropInstParams List<PropInstParam> propInstParams = new List<PropInstParam>(); foreach (Property property in properties) { PropInstParam propInstPar = new PropInstParam(); propInstPar.PropDefId = property.PropDefId; propInstPar.Val = property.Value; propInstParams.Add(propInstPar); } //Convert to the required array of arrays PropInstParamArray propInstParamsArray = new PropInstParamArray(); propInstParamsArray.Items = propInstParams.ToArray(); PropInstParamArray[] propInstParamsArrays = new PropInstParamArray[1]; propInstParamsArrays[0] = propInstParamsArray; //And finally, try to update the properties Item[] updatedItems = this.m_itemSvc.UpdateItemProperties(new long[] { editItem.RevId }, propInstParamsArrays);
And the last line is where the exception is thrown.
Anyone got any ideas?
Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube
Solved! Go to Solution.