I'm using the the UpdateItemProperties method to change one specific item property for an array of items. I use it this way:
UpdateItemProperties(itemRevIds, PropertyDefIds, Values)
itemRevIds is an array of items, PropertyDefIds is an array with length 1 with the id of a specific propertyDef, that has to be edited, Values is an array with length 1 with the value to be set.
In R2014 this worked fine, but in R2015 I get an Error 137 (IllegalInputParam), if there is more than one item in the item array.
Is there a change in behaviour in R2015?
Solved! Go to Solution.
Solved by minkd. Go to Solution.
Solved by minkd. Go to Solution.
The length of the 3 arrays you are passing should be the same.
If you want to set the same property value for 20 items, you will need to repeat the property definition and value 20 times.
-Dave
Actually, the UpdateItemProperties method doesn't appear to follow the normal "synchronized" array convention that many other methods use.
I'll have to get back to you on this one.
-Dave
In 2015 to change a single property to the same value of X items, you will need to call UpdateItemProperties X times. This is the result of an unintended side-effect of a change intended to make the Update Property calls more consistent across different entity classes. We will correct this behavior and document it better in a future release.
Another change to the UpdateItemProperties in 2015 that we missed in the documentation is that the items are no longer committed during the call. Instead we now return the items so that clients can decide to cancel or commit the change. Therefore, you should build up an array of uncommitted items from your calls to UpdateItemProperties and then call UpdateAndCommitItems at the end.
-Dave
can you please confirm, that -- for a single item -- it is not possible to change more than one property at a time, too?
It tried to pass in an array of properties and came along error 137. Going through a loop and setting each property with a single call worked.
So I have to call the UpdateItemProperties function for each item and each property leading to 100 calls for 10 items with 10 properties?
In 2015, you can update multiple properties for an item with one call, but you will have to repeat the itemID for each one of them.
-Dave
Again, thanks for your answer!
So, you have to fill in arrays of items, propertyDef-Ids and Values, each with the same size. This way, the call works!
Can't find what you're looking for? Ask the community or share your knowledge.